@mapomodule/uikit 2.0.0-beta.8 → 2.0.0-experimental.2
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 +47 -174
- package/dist/__tests__/MapoConfirmDialog.component.test.d.ts +2 -0
- package/dist/__tests__/MapoConfirmDialog.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoDetail.component.test.d.ts +2 -0
- package/dist/__tests__/MapoDetail.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoDetailLangSwitch.component.test.d.ts +2 -0
- package/dist/__tests__/MapoDetailLangSwitch.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoListActions.component.test.d.ts +2 -0
- package/dist/__tests__/MapoListActions.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoListTable.component.test.d.ts +2 -0
- package/dist/__tests__/MapoListTable.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoSnackBar.component.test.d.ts +2 -0
- package/dist/__tests__/MapoSnackBar.component.test.d.ts.map +1 -0
- package/dist/__tests__/__mocks__/nuxt-app.d.ts +9 -0
- package/dist/__tests__/__mocks__/nuxt-app.d.ts.map +1 -0
- package/dist/__tests__/formValues.test.d.ts +2 -0
- package/dist/__tests__/formValues.test.d.ts.map +1 -0
- package/dist/__tests__/langInfo.test.d.ts +2 -0
- package/dist/__tests__/langInfo.test.d.ts.map +1 -0
- package/dist/__tests__/listTable.test.d.ts +2 -0
- package/dist/__tests__/listTable.test.d.ts.map +1 -0
- package/dist/__tests__/mediaLanguages.test.d.ts +2 -0
- package/dist/__tests__/mediaLanguages.test.d.ts.map +1 -0
- package/dist/__tests__/runtimePages.test.d.ts +2 -0
- package/dist/__tests__/runtimePages.test.d.ts.map +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts.map +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -0
- package/dist/runtime/assets/main.css +1 -1
- package/dist/runtime/components/MapoConfirmDialog.vue +18 -1
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDetail.vue +263 -33
- package/dist/runtime/components/MapoDetail.vue.d.ts +191 -9
- package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDetailExtensions.vue +24 -0
- package/dist/runtime/components/MapoDetailExtensions.vue.d.ts +15 -0
- package/dist/runtime/components/MapoDetailExtensions.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue +21 -25
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts +4 -3
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDropArea.vue.d.ts +1 -1
- package/dist/runtime/components/MapoDropArea.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoList.vue +7 -3
- package/dist/runtime/components/MapoList.vue.d.ts +14 -4
- package/dist/runtime/components/MapoList.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoListActions.vue +12 -5
- package/dist/runtime/components/MapoListActions.vue.d.ts +4 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoListQuickEdit.vue +1 -1
- package/dist/runtime/components/MapoListTable.vue +99 -33
- package/dist/runtime/components/MapoListTable.vue.d.ts +11 -6
- package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaEditor.vue +10 -4
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts +1 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaFileChanger.vue +1 -1
- package/dist/runtime/components/MapoMediaManager.vue +1 -1
- package/dist/runtime/components/MapoMediaManagerDialog.vue +1 -1
- package/dist/runtime/components/MapoMediaPreview.vue +1 -1
- package/dist/runtime/components/MapoMediaUploader.vue +21 -21
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuManager.vue +23 -3
- package/dist/runtime/components/MapoMenuManager.vue.d.ts +2 -2
- package/dist/runtime/components/MapoMenuManager.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts +1 -1
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts +2 -2
- package/dist/runtime/components/MapoSnackBar.vue +11 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts.map +1 -1
- package/dist/runtime/composables/defineDetailExtension.d.ts +32 -0
- package/dist/runtime/composables/defineDetailExtension.d.ts.map +1 -0
- package/dist/runtime/composables/defineDetailExtension.js +34 -0
- package/dist/runtime/composables/useMapoDetail.d.ts +18 -0
- package/dist/runtime/composables/useMapoDetail.d.ts.map +1 -0
- package/dist/runtime/composables/useMapoDetail.js +5 -0
- package/dist/runtime/page-meta.nuxt.d.ts +4 -0
- package/dist/runtime/stores/media.d.ts +8 -2
- package/dist/runtime/stores/media.d.ts.map +1 -1
- package/dist/runtime/stores/media.js +16 -0
- package/dist/runtime/types/detail.d.ts +167 -0
- package/dist/runtime/types/detail.d.ts.map +1 -0
- package/dist/runtime/types/detail.js +0 -0
- package/dist/runtime/types/list.d.ts +10 -2
- package/dist/runtime/types/list.d.ts.map +1 -1
- package/dist/runtime/utils/formValues.d.ts +8 -0
- package/dist/runtime/utils/formValues.d.ts.map +1 -0
- package/dist/runtime/utils/formValues.js +19 -0
- package/dist/runtime/utils/langInfo.d.ts +30 -0
- package/dist/runtime/utils/langInfo.d.ts.map +1 -0
- package/dist/runtime/utils/langInfo.js +8 -0
- package/dist/runtime/utils/listTable.d.ts +29 -0
- package/dist/runtime/utils/listTable.d.ts.map +1 -0
- package/dist/runtime/utils/listTable.js +21 -0
- package/package.json +7 -8
- package/src/__tests__/MapoConfirmDialog.component.test.ts +165 -0
- package/src/__tests__/MapoDetail.component.test.ts +1107 -0
- package/src/__tests__/MapoDetailLangSwitch.component.test.ts +145 -0
- package/src/__tests__/MapoListActions.component.test.ts +175 -0
- package/src/__tests__/MapoListTable.component.test.ts +504 -0
- package/src/__tests__/MapoSnackBar.component.test.ts +79 -0
- package/src/__tests__/__mocks__/nuxt-app.ts +8 -0
- package/src/__tests__/formValues.test.ts +31 -0
- package/src/__tests__/langInfo.test.ts +48 -0
- package/src/__tests__/listTable.test.ts +82 -0
- package/src/__tests__/mediaLanguages.test.ts +66 -0
- package/src/__tests__/runtimePages.test.ts +17 -0
- package/src/index.ts +8 -0
- package/src/module.ts +12 -0
- package/src/runtime/assets/main.css +13 -0
- package/src/runtime/components/MapoConfirmDialog.vue +28 -1
- package/src/runtime/components/MapoDetail.vue +481 -53
- package/src/runtime/components/MapoDetailExtensions.vue +39 -0
- package/src/runtime/components/MapoDetailLangSwitch.vue +26 -27
- package/src/runtime/components/MapoList.vue +20 -5
- package/src/runtime/components/MapoListActions.vue +16 -4
- package/src/runtime/components/MapoListTable.vue +128 -41
- package/src/runtime/components/MapoMediaEditor.vue +17 -4
- package/src/runtime/components/MapoMediaUploader.vue +25 -21
- package/src/runtime/components/MapoMenuManager.vue +38 -3
- package/src/runtime/components/MapoSnackBar.vue +12 -0
- package/src/runtime/composables/defineDetailExtension.ts +78 -0
- package/src/runtime/composables/useMapoDetail.ts +24 -0
- package/src/runtime/page-meta.nuxt.d.ts +4 -0
- package/src/runtime/stores/media.ts +32 -0
- package/src/runtime/types/detail.ts +178 -0
- package/src/runtime/types/list.ts +10 -2
- package/src/runtime/utils/formValues.ts +28 -0
- package/src/runtime/utils/langInfo.ts +38 -0
- package/src/runtime/utils/listTable.ts +54 -0
package/README.md
CHANGED
|
@@ -1,199 +1,72 @@
|
|
|
1
1
|
# @mapomodule/uikit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Built on [Nuxt UI v3](https://ui.nuxt.com) + [Tailwind v4](https://tailwindcss.com).
|
|
3
|
+
Everything an admin user sees in Mapo: the layouts, sidebar, topbar and login page, the list and detail pages, the media manager, the menu editor and the feedback components, plus theming and the MapoOverride system. Built on Nuxt UI v4 and Tailwind CSS v4.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Install it through the meta-package [`mapomodule`](https://www.npmjs.com/package/mapomodule), which also registers the `core`, `store`, `form` and `i18n` modules these components rely on. Configure it under `mapo.uikit`, and register `@nuxt/ui` before `mapomodule`:
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
|
-
pnpm add @
|
|
10
|
+
pnpm add mapomodule@next @nuxt/ui
|
|
13
11
|
```
|
|
14
12
|
|
|
15
13
|
```ts
|
|
16
|
-
// nuxt.config.ts
|
|
14
|
+
// nuxt.config.ts
|
|
17
15
|
export default defineNuxtConfig({
|
|
18
|
-
modules: ["@nuxt/ui", "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
When installed via `mapomodule`, configure under `mapo.uikit` instead.
|
|
27
|
-
|
|
28
|
-
## What you get
|
|
29
|
-
|
|
30
|
-
### Layouts
|
|
31
|
-
|
|
32
|
-
| Layout | Description |
|
|
33
|
-
| -------------- | ------------------------------------------------------------------------ |
|
|
34
|
-
| `mapo-default` | Full admin shell: collapsible sidebar + topbar + scrollable content area |
|
|
35
|
-
| `mapo-empty` | Bare wrapper — used for the login page |
|
|
36
|
-
|
|
37
|
-
### Components (auto-imported)
|
|
38
|
-
|
|
39
|
-
#### Layout & navigation
|
|
40
|
-
|
|
41
|
-
| Component | Description |
|
|
42
|
-
| --------------------- | ---------------------------------------------------------------------------- |
|
|
43
|
-
| `MapoSidebar` | Collapsible sidebar with mini mode, auto-nav from route meta, footer section |
|
|
44
|
-
| `MapoSidebarList` | Recursive nav tree built from `route.meta.label` / `meta.parent` |
|
|
45
|
-
| `MapoSidebarListItem` | Single nav item with permission filtering and nested collapse |
|
|
46
|
-
| `MapoSidebarProfile` | User profile row (avatar + username + logout) for the sidebar footer |
|
|
47
|
-
| `MapoTopbar` | Top bar with drawer toggle and left/default/right slots |
|
|
48
|
-
| `MapoThemeToggle` | Dark/light mode toggle via `useColorMode()` — drop-in for any slot |
|
|
49
|
-
| `MapoLogoutButton` | Standalone logout button with `variant`, `color`, `size`, `iconOnly` props |
|
|
50
|
-
|
|
51
|
-
#### Feedback
|
|
52
|
-
|
|
53
|
-
| Component | Description |
|
|
54
|
-
| -------------------- | --------------------------------------------------------- |
|
|
55
|
-
| `MapoLogin` | Split-panel login form; slots: `brand`, `panel`, `footer` |
|
|
56
|
-
| `MapoSnackBar` | Imperative snackbar driven by `useSnackStore` |
|
|
57
|
-
| `MapoConfirmDialog` | Promise-based confirm dialog driven by `useConfirmStore` |
|
|
58
|
-
| `MapoRootComponents` | Mounts `MapoSnackBar` + `MapoConfirmDialog` in the layout |
|
|
59
|
-
|
|
60
|
-
#### List engine
|
|
61
|
-
|
|
62
|
-
| Component | Description |
|
|
63
|
-
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
-
| `MapoList` | Full list shell: composes head, filters, actions, tabs, table, and quick-edit. URL state (page, sort, search, filters, tab) synced automatically. |
|
|
65
|
-
| `MapoListHead` | Title, search bar, and primary action button row |
|
|
66
|
-
| `MapoListFilters` | Filter panel driven by `FilterDescriptor[]`. v1 backend contract (`key=v1,v2`); per-filter override slots (`filter.{value}` / `.title` / `.content` / `.icon`) |
|
|
67
|
-
| `MapoListActions` | Bulk-action toolbar (delete, reorder) — appears on selection. Supports `ActionDescriptor.dangerous` to render Apply/confirm with error styling for destructive actions. |
|
|
68
|
-
| `MapoListTabs` | Tabbed status filter via `meta.tabs` |
|
|
69
|
-
| `MapoListTable` | Data table with server-side pagination, sort, selection, and whole-row drag reorder (drop-line feedback; auto-disabled while a search/sort is active). Pass `permissionModel` to gate edit/delete row actions. |
|
|
70
|
-
| `MapoListQuickEdit` | Quick-edit modal driven by the same `FieldDescriptor[]` as the detail form |
|
|
71
|
-
|
|
72
|
-
#### Media Manager
|
|
73
|
-
|
|
74
|
-
| Component | Description |
|
|
75
|
-
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
76
|
-
| `MapoDropArea` | Standalone drag-and-drop area (reusable outside media manager) |
|
|
77
|
-
| `MapoMediaPreview` | MIME-aware preview: `image` → `<img>`, `video` → `<video>`, other → file icon |
|
|
78
|
-
| `MapoMediaBreadcrumbs` | Folder navigation breadcrumb |
|
|
79
|
-
| `MapoMediaFolders` | Folder sidebar with MIME filters (image/video/audio/document) |
|
|
80
|
-
| `MapoMediaGallery` | Responsive CSS Grid gallery with bulk selection and pagination |
|
|
81
|
-
| `MapoMediaEditor` | Right-side drawer for editing media metadata (title, alt text, translations); shows linked models, open-in-new-tab, and gates Edit/Delete on the media model permissions |
|
|
82
|
-
| `MapoMediaFileChanger` | Replace an existing file while optionally preserving its URL |
|
|
83
|
-
| `MapoMediaUploader` | Upload queue with per-file progress, inline metadata (title/alt/description), and destination-folder selection |
|
|
84
|
-
| `MapoMediaManager` | Main orchestrator shell (sidebar + gallery + uploader + editor drawer) |
|
|
85
|
-
| `MapoMediaManagerDialog` | `UModal` wrapper for picker mode — single or multi selection with confirm |
|
|
86
|
-
|
|
87
|
-
**Form fields** — the `media`, `media-m2m`, and `enhanced-media` field types ship with [`@mapomodule/form`](../form/README.md) in its default registry; they drive the picker above and need this package installed to work.
|
|
88
|
-
|
|
89
|
-
Media config (endpoints + upload limits) goes under `mapo.uikit.media`; backend-specific request/response transforms are handled by a pluggable `$mapoMediaAdapter` (Camomilla ships its own). See [docs/uikit/media.md](../../../docs/uikit/media.md).
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
mapo: {
|
|
93
|
-
uikit: {
|
|
94
|
-
media: {
|
|
95
|
-
endpoints: { media: "/api/media", folders: "/api/media-folders" },
|
|
96
|
-
maxImageSize: 10, // MB
|
|
97
|
-
maxVideoSize: 100, // MB
|
|
98
|
-
permissionsModel: "media", // Django model for editor change/delete checks
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
#### Detail shell
|
|
105
|
-
|
|
106
|
-
| Component | Description |
|
|
107
|
-
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
108
|
-
| `MapoDetail` | Two-column detail shell: `useCrud` lifecycle, differential PATCH, error mapping, draft auto-save (`:draft="true"`). Supports permission gating (`permissionModel`), multipart control (`multipart`), live preview (`previewField`), and backend-derived languages (`forceLanguages`). |
|
|
109
|
-
| `MapoDetailLangSwitch` | Language tabs with per-language error badge — syncs the `?lang=` query param |
|
|
110
|
-
|
|
111
|
-
### Layout slots (`mapo-default`)
|
|
112
|
-
|
|
113
|
-
| Slot | Renders in |
|
|
114
|
-
| -------------------- | ---------------------------------------------------- |
|
|
115
|
-
| `sidebar:logo` | Sidebar header — replaces the default logo/name link |
|
|
116
|
-
| `sidebar:nav-top` | Above the auto-generated nav list |
|
|
117
|
-
| `sidebar:nav-bottom` | Below the nav list, above the footer row |
|
|
118
|
-
| `sidebar:footer` | Replaces the user avatar + logout row |
|
|
119
|
-
| `topbar:left` | Immediately after the drawer toggle button |
|
|
120
|
-
| `topbar` | Center area of the topbar (flex-1) |
|
|
121
|
-
| `topbar:right` | Right cluster of the topbar |
|
|
122
|
-
|
|
123
|
-
## Theming
|
|
124
|
-
|
|
125
|
-
### ① CSS token override
|
|
126
|
-
|
|
127
|
-
Pass a CSS file via `mapo.uikit.css`. It is loaded **after** the base uikit CSS so your values always win:
|
|
128
|
-
|
|
129
|
-
```css
|
|
130
|
-
/* assets/css/theme.css */
|
|
131
|
-
@import "tailwindcss";
|
|
132
|
-
@import "@nuxt/ui";
|
|
133
|
-
|
|
134
|
-
:root {
|
|
135
|
-
--color-primary-500: oklch(0.59 0.25 290); /* violet */
|
|
136
|
-
--ui-radius: var(--radius-lg);
|
|
137
|
-
--ui-bg: var(--color-neutral-50);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.dark {
|
|
141
|
-
--ui-bg: var(--color-neutral-950);
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### ② Nuxt UI component defaults
|
|
146
|
-
|
|
147
|
-
Pass a partial Nuxt UI config via `mapo.uikit.ui`. Deep-merged into `nuxt.options.ui`:
|
|
148
|
-
|
|
149
|
-
```ts
|
|
150
|
-
mapo: {
|
|
151
|
-
uikit: {
|
|
152
|
-
ui: {
|
|
153
|
-
button: { defaultVariants: { color: "primary", variant: "solid" } },
|
|
154
|
-
card: { slots: { root: "rounded-xl shadow-md" } },
|
|
155
|
-
input: { defaultVariants: { variant: "outline" } },
|
|
16
|
+
modules: ["@nuxt/ui", "mapomodule"],
|
|
17
|
+
mapo: {
|
|
18
|
+
uikit: {
|
|
19
|
+
css: "~/assets/css/theme.css",
|
|
20
|
+
media: {
|
|
21
|
+
endpoints: { media: "/api/media", folders: "/api/media-folders" },
|
|
22
|
+
},
|
|
156
23
|
},
|
|
157
24
|
},
|
|
158
|
-
}
|
|
25
|
+
});
|
|
159
26
|
```
|
|
160
27
|
|
|
161
|
-
|
|
28
|
+
Mapo v2 is published on the `next` dist-tag while it is in beta.
|
|
162
29
|
|
|
163
|
-
|
|
30
|
+
| Option | Default | Description |
|
|
31
|
+
| ------------------------- | ---------------------- | --------------------------------------------------------------------------------------------- |
|
|
32
|
+
| `css` | — | Your CSS file, loaded after Mapo's base CSS so its tokens win |
|
|
33
|
+
| `ui` | `{}` | Nuxt UI component defaults, merged into `nuxt.options.ui`; keys the app sets there itself win |
|
|
34
|
+
| `media.endpoints.media` | `"/api/media"` | Media endpoint |
|
|
35
|
+
| `media.endpoints.folders` | `"/api/media-folders"` | Media folders endpoint |
|
|
36
|
+
| `media.maxImageSize` | `10` | Upload limit for images, in MB |
|
|
37
|
+
| `media.maxVideoSize` | `100` | Upload limit for videos, in MB |
|
|
38
|
+
| `media.permissionsModel` | `"media"` | Django model whose permissions gate editing and deleting in the media editor |
|
|
164
39
|
|
|
165
|
-
|
|
166
|
-
app/
|
|
167
|
-
└── mapooverride/
|
|
168
|
-
├── MapoTopbar.vue ← replaces MapoTopbar globally
|
|
169
|
-
├── MapoSidebar.vue
|
|
170
|
-
└── MapoLogin.vue
|
|
171
|
-
```
|
|
40
|
+
## What you get
|
|
172
41
|
|
|
173
|
-
|
|
42
|
+
Components are auto-imported.
|
|
174
43
|
|
|
175
|
-
|
|
44
|
+
| Area | Components and APIs |
|
|
45
|
+
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| Shell | The `mapo-default` and `mapo-empty` layouts, `MapoSidebar` (built from route metadata), `MapoTopbar`, `MapoLogin`, `MapoThemeToggle`, `MapoLangSwitcher`, `MapoLogoutButton`; a `/login` and a `/` page when the app has none |
|
|
47
|
+
| Lists | `MapoList`: server-side pagination, search, sorting, filters, tabs, bulk actions, drag reorder and quick edit, with the state synced to the URL |
|
|
48
|
+
| Details | `MapoDetail`: loads the record, renders the form, saves a differential `PATCH`, maps 400 errors onto fields, drafts and per-language editing; `useMapoDetail()` and `defineDetailExtension()` for what goes inside |
|
|
49
|
+
| Media | `MapoMediaManager`, the `MapoMediaManagerDialog` picker, `useMediaStore`, and `$mapoMediaAdapter`, which backend integrations replace |
|
|
50
|
+
| Menus | `MapoMenuManager`: a drag-and-drop tree editor with per-language trees |
|
|
51
|
+
| Feedback | `MapoSnackBar` and `MapoConfirmDialog`, driven by the store and mounted by `MapoRootComponents` in `mapo-default` |
|
|
176
52
|
|
|
177
|
-
|
|
53
|
+
The layout exposes the slots `sidebar:logo`, `sidebar:nav-top`, `sidebar:nav-bottom`, `sidebar:footer`, `topbar:left`, `topbar` and `topbar:right`. Every component's props, events and slots are in the component API reference.
|
|
178
54
|
|
|
179
|
-
|
|
180
|
-
# watch mode — rebuilds dist/ on every src/ change
|
|
181
|
-
pnpm --filter @mapomodule/uikit dev
|
|
55
|
+
## Customization
|
|
182
56
|
|
|
183
|
-
|
|
184
|
-
pnpm dev:uikit
|
|
185
|
-
```
|
|
57
|
+
Pick the lightest layer that does the job:
|
|
186
58
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
# terminal 2
|
|
194
|
-
pnpm dev:example-theme # theming demo at http://localhost:3001
|
|
195
|
-
```
|
|
59
|
+
1. **CSS tokens** through `mapo.uikit.css`, for colours, radius and dark mode.
|
|
60
|
+
2. **Nuxt UI defaults** through `mapo.uikit.ui`, for component variants across the app.
|
|
61
|
+
3. **Slots** on the layout and on Mapo components, for structural additions.
|
|
62
|
+
4. **Detail extensions**: `defineDetailExtension()` adds an action or a section to every `MapoDetail`, which reads the record with `useMapoDetail()`.
|
|
63
|
+
5. **MapoOverride**: a file at `app/mapooverride/<Name>.vue` replaces the registered component with that name at build time. Keep its props, events and slots compatible; from then on you own its updates.
|
|
196
64
|
|
|
197
|
-
##
|
|
65
|
+
## Documentation
|
|
198
66
|
|
|
199
|
-
|
|
67
|
+
- [UIKit](https://lotrekagency.github.io/mapo-new/uikit/)
|
|
68
|
+
- [Layout](https://lotrekagency.github.io/mapo-new/uikit/layout), [Sidebar](https://lotrekagency.github.io/mapo-new/uikit/sidebar), [Login](https://lotrekagency.github.io/mapo-new/uikit/login)
|
|
69
|
+
- [MapoList](https://lotrekagency.github.io/mapo-new/uikit/list), [MapoDetail](https://lotrekagency.github.io/mapo-new/uikit/detail)
|
|
70
|
+
- [Media Manager](https://lotrekagency.github.io/mapo-new/uikit/media), [Menu Manager](https://lotrekagency.github.io/mapo-new/uikit/menu-manager)
|
|
71
|
+
- [Theming](https://lotrekagency.github.io/mapo-new/uikit/theming), [MapoOverride System](https://lotrekagency.github.io/mapo-new/uikit/mapoverride)
|
|
72
|
+
- [UIKit — Component API Reference](https://lotrekagency.github.io/mapo-new/uikit/api)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoConfirmDialog.component.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/MapoConfirmDialog.component.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoDetail.component.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/MapoDetail.component.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoDetailLangSwitch.component.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/MapoDetailLangSwitch.component.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoListActions.component.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/MapoListActions.component.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoListTable.component.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/MapoListTable.component.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoSnackBar.component.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/MapoSnackBar.component.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placeholder for Nuxt's `#app` in component tests. Nuxt provides `#app` only
|
|
3
|
+
* inside a Nuxt build, but the client transform must resolve every import, so
|
|
4
|
+
* `vitest.config.ts` points `#app` here. It exports nothing on purpose: each test
|
|
5
|
+
* replaces it with `vi.mock("#app", factory)`, holding the composables the
|
|
6
|
+
* component under test calls.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=nuxt-app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt-app.d.ts","sourceRoot":"","sources":["../../../src/__tests__/__mocks__/nuxt-app.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formValues.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/formValues.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langInfo.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/langInfo.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTable.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/listTable.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaLanguages.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/mediaLanguages.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimePages.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/runtimePages.test.ts"],"names":[],"mappings":""}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { MapoUikitOptions } from './module.mjs';
|
|
2
2
|
export { ActionContext, ActionDescriptor, ActiveFilter, FilterChoice, FilterDescriptor, ListColumn, ListTabItem } from '../dist/runtime/types/list.js';
|
|
3
3
|
export { MediaApiResponse, MediaFolder, MediaGetRootParams, MediaItem, MediaUploadPayload, SelectMode } from '../dist/runtime/types/media.js';
|
|
4
|
+
export { DetailExtension, DetailExtensionLoader, DetailExtensionPlacement, MapoDetailContext, MapoDetailDraft, MapoDetailDraftPart } from '../dist/runtime/types/detail.js';
|
|
4
5
|
export { MapoMenu, MenuNodeLink, MenuTranslation, MenuTreeNode, createMenuNode, findMenuNode, menuTreeDepth, removeMenuNode } from '../dist/runtime/types/menu.js';
|
|
5
6
|
import '@nuxt/schema';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { MapoUikitOptions } from "./module";
|
|
2
2
|
export type { ListColumn, FilterChoice, FilterDescriptor, ActiveFilter, ActionContext, ActionDescriptor, ListTabItem, } from "./runtime/types/list.js";
|
|
3
3
|
export type { MediaItem, MediaFolder, MediaApiResponse, MediaGetRootParams, MediaUploadPayload, SelectMode, } from "./runtime/types/media.js";
|
|
4
|
+
export type { MapoDetailContext, MapoDetailDraft, MapoDetailDraftPart, DetailExtension, DetailExtensionLoader, DetailExtensionPlacement, } from "./runtime/types/detail.js";
|
|
4
5
|
export type { MapoMenu, MenuTreeNode, MenuNodeLink, MenuTranslation, } from "./runtime/types/menu.js";
|
|
5
6
|
export { createMenuNode, menuTreeDepth, findMenuNode, removeMenuNode, } from "./runtime/types/menu.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,yBAAyB,CAAC"}
|
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE;QACV,gFAAgF;QAChF,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,8DAA8D;QAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;;AAaD,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE;QACV,gFAAgF;QAChF,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,8DAA8D;QAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;;AAaD,wBAgP0C"}
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -81,6 +81,7 @@ const module$1 = defineNuxtModule({
|
|
|
81
81
|
"MapoThemeToggle",
|
|
82
82
|
// ─── CRUD / Detail / List ─────────────────────────────────────────────
|
|
83
83
|
"MapoDetail",
|
|
84
|
+
"MapoDetailExtensions",
|
|
84
85
|
"MapoDetailLangSwitch",
|
|
85
86
|
"MapoList",
|
|
86
87
|
"MapoListHead",
|
|
@@ -143,6 +144,15 @@ const module$1 = defineNuxtModule({
|
|
|
143
144
|
{
|
|
144
145
|
name: "useMediaStore",
|
|
145
146
|
from: resolver.resolve("./runtime/stores/media")
|
|
147
|
+
},
|
|
148
|
+
// The detail context and its extensions
|
|
149
|
+
{
|
|
150
|
+
name: "useMapoDetail",
|
|
151
|
+
from: resolver.resolve("./runtime/composables/useMapoDetail")
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "defineDetailExtension",
|
|
155
|
+
from: resolver.resolve("./runtime/composables/defineDetailExtension")
|
|
146
156
|
}
|
|
147
157
|
]);
|
|
148
158
|
nuxt.hook("components:extend", (components2) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tailwindcss";@import "@nuxt/ui";@source "../components/**/*.vue";@source "../layouts/**/*.vue";@source "../pages/**/*.vue";@source "../../../../form/src/runtime/components/**/*.vue";@source "../../../../form/src/runtime/composables/**/*.ts";@source inline("col-span-1 col-span-2 col-span-3 col-span-4 col-span-5 col-span-6 col-span-7 col-span-8 col-span-9 col-span-10 col-span-11 col-span-12");@source inline("md:col-span-1 md:col-span-2 md:col-span-3 md:col-span-4 md:col-span-5 md:col-span-6 md:col-span-7 md:col-span-8 md:col-span-9 md:col-span-10 md:col-span-11 md:col-span-12");@source inline("grid-cols-12");@source inline("flex-1 min-h-0 h-full");.mapo-group-expand-body,.mapo-group-expand-body .mapo-form-field,.mapo-group-expand-body .mapo-form-field>div,.mapo-group-expand-body>*{flex:1;min-height:0}.mapo-group-expand-body [contenteditable],.mapo-group-expand-body textarea{height:100%!important;overflow-y:auto!important;resize:none!important}.mapo-group-expand-body .mapo-form-field>div>*{height:100%}@layer base{body,html{height:100%}:root{--mapo-topbar-height:56px}#__nuxt,#__nuxt>*{height:100%}}
|
|
1
|
+
@import "tailwindcss";@import "@nuxt/ui";@source "../components/**/*.vue";@source "../layouts/**/*.vue";@source "../pages/**/*.vue";@source "../../../../form/src/runtime/components/**/*.vue";@source "../../../../form/src/runtime/composables/**/*.ts";@source "../../../../ai/src/runtime/components/**/*.vue";@source inline("col-span-1 col-span-2 col-span-3 col-span-4 col-span-5 col-span-6 col-span-7 col-span-8 col-span-9 col-span-10 col-span-11 col-span-12");@source inline("md:col-span-1 md:col-span-2 md:col-span-3 md:col-span-4 md:col-span-5 md:col-span-6 md:col-span-7 md:col-span-8 md:col-span-9 md:col-span-10 md:col-span-11 md:col-span-12");@source inline("grid-cols-12");@source inline("flex-1 min-h-0 h-full");.mapo-group-expand-body,.mapo-group-expand-body .mapo-form-field,.mapo-group-expand-body .mapo-form-field>div,.mapo-group-expand-body>*{flex:1;min-height:0}.mapo-group-expand-body [contenteditable],.mapo-group-expand-body textarea{height:100%!important;overflow-y:auto!important;resize:none!important}.mapo-group-expand-body .mapo-form-field>div>*{height:100%}@layer base{body,html{height:100%}:root{--mapo-topbar-height:56px}#__nuxt,#__nuxt>*{height:100%}[role=button]:not(:disabled),button:not(:disabled){cursor:pointer}}
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, watch } from "vue";
|
|
2
3
|
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { useConfirmStore } from "@mapomodule/store/runtime/stores/confirm";
|
|
4
5
|
const { t } = useI18n();
|
|
5
6
|
const store = useConfirmStore();
|
|
7
|
+
const modalMounted = ref(store.active);
|
|
8
|
+
watch(
|
|
9
|
+
() => store.active,
|
|
10
|
+
(active) => {
|
|
11
|
+
if (active) modalMounted.value = true;
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
function onAfterLeave() {
|
|
15
|
+
if (store.active) return;
|
|
16
|
+
modalMounted.value = false;
|
|
17
|
+
}
|
|
6
18
|
</script>
|
|
7
19
|
|
|
8
20
|
<template>
|
|
9
|
-
<UModal
|
|
21
|
+
<UModal
|
|
22
|
+
v-if="modalMounted"
|
|
23
|
+
v-model:open="store.active"
|
|
24
|
+
:dismissible="false"
|
|
25
|
+
@after:leave="onAfterLeave"
|
|
26
|
+
>
|
|
10
27
|
<template #content>
|
|
11
28
|
<div class="p-6 space-y-4">
|
|
12
29
|
<div class="space-y-1">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapoConfirmDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoConfirmDialog.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapoConfirmDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoConfirmDialog.vue"],"names":[],"mappings":"AAyOA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|