@zoobzio/nuxt 0.0.10 → 0.0.11
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 +119 -22
- package/app/app.d.ts +51 -0
- package/app/components/accordion.ts +13 -0
- package/app/components/breadcrumb.ts +12 -0
- package/app/components/browser.ts +41 -0
- package/app/components/calendar.ts +13 -0
- package/app/components/checkbox.ts +9 -0
- package/app/components/command.ts +20 -0
- package/app/components/date-filters.ts +22 -0
- package/app/components/date-picker.ts +14 -0
- package/app/components/date-range-picker.ts +14 -0
- package/app/components/directory.ts +12 -0
- package/app/components/editor.ts +11 -0
- package/app/components/facets.ts +13 -0
- package/app/components/file-input.ts +10 -0
- package/app/components/form-field.ts +25 -0
- package/app/components/form.ts +10 -0
- package/app/components/hero.ts +9 -0
- package/app/components/icon.ts +36 -0
- package/app/components/keywords.ts +20 -0
- package/app/components/menu.ts +17 -0
- package/app/components/multi-select.ts +12 -0
- package/app/components/pagination.ts +18 -0
- package/app/components/range-calendar.ts +13 -0
- package/app/components/rich-text.ts +11 -0
- package/app/components/scroller.ts +9 -0
- package/app/components/segmented-control.ts +12 -0
- package/app/components/select.ts +9 -0
- package/app/components/table.ts +50 -0
- package/app/components/tabs.ts +12 -0
- package/app/components/tags-input.ts +9 -0
- package/app/components/toast.ts +9 -0
- package/app/components/tree.ts +14 -0
- package/app/constants/editor.ts +23 -0
- package/app/types/icon.ts +10 -0
- package/app/utils/editor.ts +10 -0
- package/modules/imports/constant.ts +41 -6
- package/modules/imports/index.ts +1 -1
- package/nuxt.config.ts +11 -0
- package/package.json +9 -7
- package/app/components/breadcrumb.vue +0 -65
- package/app/components/browser.vue +0 -79
- package/app/components/directory.vue +0 -65
- package/app/components/hero.vue +0 -59
- package/app/components/menu.vue +0 -64
- package/app/components/segmented-control.vue +0 -67
- package/app/components/table.vue +0 -68
- package/app/components/tabs.vue +0 -63
- package/app/components/tree.vue +0 -67
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The vue scroller with the `top` icon before its back-to-top label.
|
|
2
|
+
import Core from "@zoobzio/vue/components/scroller.vue";
|
|
3
|
+
|
|
4
|
+
import { icon } from "./icon";
|
|
5
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
6
|
+
|
|
7
|
+
export default wrap(Core, {
|
|
8
|
+
slots: { backToTopPrepend: () => [icon("top")] },
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The vue segmented control with NuxtLink under its `link` part and an
|
|
2
|
+
// option's `icon` drawn before its label.
|
|
3
|
+
import Core from "@zoobzio/vue/components/segmented-control.vue";
|
|
4
|
+
|
|
5
|
+
import NuxtLink from "#app/components/nuxt-link";
|
|
6
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
7
|
+
import { iconOf } from "./icon";
|
|
8
|
+
|
|
9
|
+
export default wrap(Core, {
|
|
10
|
+
pt: { link: () => ({ as: NuxtLink }) },
|
|
11
|
+
slots: { itemPrepend: ({ option }) => iconOf(option.icon) },
|
|
12
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The vue select with the `expand` icon after its display.
|
|
2
|
+
import Core from "@zoobzio/vue/components/select.vue";
|
|
3
|
+
|
|
4
|
+
import { icon } from "./icon";
|
|
5
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
6
|
+
|
|
7
|
+
export default wrap(Core, {
|
|
8
|
+
slots: { triggerAppend: () => [icon("expand")] },
|
|
9
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// The vue table with the layer's parts behind its own: NuxtLink under the
|
|
2
|
+
// body's `link`, the layer's Menu for row actions (so an action's `icon`
|
|
3
|
+
// draws), the layer's Checkbox for the row and select-all checkboxes, the
|
|
4
|
+
// layer's Command behind the column manager, and the layer's Pagination.
|
|
5
|
+
// Its Fab slots draw the `refresh`, `columns`, and `actions` icons; the
|
|
6
|
+
// head draws `drag` on each handle and `sort-asc` or `sort-desc` after a
|
|
7
|
+
// sorted header; a bulk action draws its own `icon`.
|
|
8
|
+
import type { TableBodyPassthrough } from "@zoobzio/vue/types/components/table-body";
|
|
9
|
+
import type { TableColumnsPassthrough } from "@zoobzio/vue/types/components/table-columns";
|
|
10
|
+
import type { TableHeadPassthrough } from "@zoobzio/vue/types/components/table-head";
|
|
11
|
+
|
|
12
|
+
import Core from "@zoobzio/vue/components/table.vue";
|
|
13
|
+
|
|
14
|
+
import NuxtLink from "#app/components/nuxt-link";
|
|
15
|
+
import { layer } from "@zoobzio/vue/utils/passthrough";
|
|
16
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
17
|
+
import Checkbox from "./checkbox";
|
|
18
|
+
import Command from "./command";
|
|
19
|
+
import Menu from "./menu";
|
|
20
|
+
import Pagination from "./pagination";
|
|
21
|
+
import { icon, iconOf, iconPart } from "./icon";
|
|
22
|
+
|
|
23
|
+
export default wrap(Core, {
|
|
24
|
+
pt: (pt) => ({
|
|
25
|
+
...pt,
|
|
26
|
+
pagination: { as: Pagination, ...pt?.pagination },
|
|
27
|
+
head: layer<TableHeadPassthrough>(pt?.head, {
|
|
28
|
+
selectAllCheckbox: { as: Checkbox },
|
|
29
|
+
}),
|
|
30
|
+
body: layer<TableBodyPassthrough<unknown>>(pt?.body, {
|
|
31
|
+
link: () => ({ as: NuxtLink }),
|
|
32
|
+
rowCheckbox: { as: Checkbox },
|
|
33
|
+
actionsMenu: { as: Menu },
|
|
34
|
+
}),
|
|
35
|
+
columns: layer<TableColumnsPassthrough>(pt?.columns, {
|
|
36
|
+
command: { as: Command },
|
|
37
|
+
}),
|
|
38
|
+
}),
|
|
39
|
+
slots: {
|
|
40
|
+
refresh: ({ settings }) => iconPart(settings.refresh, "refresh"),
|
|
41
|
+
columns: ({ settings }) => iconPart(settings.trigger, "columns"),
|
|
42
|
+
actions: ({ settings }) => iconPart(settings.actionsTrigger, "actions"),
|
|
43
|
+
dragPrepend: () => [icon("drag")],
|
|
44
|
+
headerAppend: ({ table, column }) =>
|
|
45
|
+
table.isSorted(column)
|
|
46
|
+
? [icon(table.sortDirection === "asc" ? "sort-asc" : "sort-desc")]
|
|
47
|
+
: [],
|
|
48
|
+
bulkActionPrepend: ({ action }) => iconOf(action.icon),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The vue tabs with NuxtLink under its `link` part and an option's `icon`
|
|
2
|
+
// drawn before its label.
|
|
3
|
+
import Core from "@zoobzio/vue/components/tabs.vue";
|
|
4
|
+
|
|
5
|
+
import NuxtLink from "#app/components/nuxt-link";
|
|
6
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
7
|
+
import { iconOf } from "./icon";
|
|
8
|
+
|
|
9
|
+
export default wrap(Core, {
|
|
10
|
+
pt: { link: () => ({ as: NuxtLink }) },
|
|
11
|
+
slots: { triggerPrepend: ({ option }) => iconOf(option.icon) },
|
|
12
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The vue tags input with the `remove` icon before each tag's delete label.
|
|
2
|
+
import Core from "@zoobzio/vue/components/tags-input.vue";
|
|
3
|
+
|
|
4
|
+
import { icon } from "./icon";
|
|
5
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
6
|
+
|
|
7
|
+
export default wrap(Core, {
|
|
8
|
+
slots: { itemDeletePrepend: () => [icon("remove")] },
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The vue toast with the `close` icon before its close label.
|
|
2
|
+
import Core from "@zoobzio/vue/components/toast.vue";
|
|
3
|
+
|
|
4
|
+
import { icon } from "./icon";
|
|
5
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
6
|
+
|
|
7
|
+
export default wrap(Core, {
|
|
8
|
+
slots: { closePrepend: () => [icon("close")] },
|
|
9
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The vue tree with NuxtLink under its `link` part and the `expand` icon as
|
|
2
|
+
// the toggle of each branch.
|
|
3
|
+
import Core from "@zoobzio/vue/components/tree.vue";
|
|
4
|
+
|
|
5
|
+
import NuxtLink from "#app/components/nuxt-link";
|
|
6
|
+
import { wrap } from "@zoobzio/vue/utils/wrap";
|
|
7
|
+
import { icon } from "./icon";
|
|
8
|
+
|
|
9
|
+
export default wrap(Core, {
|
|
10
|
+
pt: { link: () => ({ as: NuxtLink }) },
|
|
11
|
+
slots: {
|
|
12
|
+
itemToggle: ({ item }) => (item.hasChildren ? [icon("expand")] : []),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IconAlias } from "../types/icon";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The icon of each editor tool, by the tool's key: the marks, the blocks,
|
|
5
|
+
* and history. A heading tool's key carries its level (`heading-2`), and
|
|
6
|
+
* every level draws the one `heading` icon beside its `H<n>` label. The
|
|
7
|
+
* editor and rich text wrappers draw these in `toolPrepend`.
|
|
8
|
+
*/
|
|
9
|
+
export const EDITOR_TOOL_ICONS: Readonly<Record<string, IconAlias>> = {
|
|
10
|
+
bold: "bold",
|
|
11
|
+
italic: "italic",
|
|
12
|
+
underline: "underline",
|
|
13
|
+
strike: "strike",
|
|
14
|
+
code: "code",
|
|
15
|
+
heading: "heading",
|
|
16
|
+
bulletList: "bullet-list",
|
|
17
|
+
orderedList: "ordered-list",
|
|
18
|
+
blockquote: "blockquote",
|
|
19
|
+
codeBlock: "code-block",
|
|
20
|
+
horizontalRule: "rule",
|
|
21
|
+
undo: "undo",
|
|
22
|
+
redo: "redo",
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Alias } from "#build/types/icon-sheets.d.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An icon alias the app's sprite holds. `@icon-sheets/nuxt` derives the
|
|
5
|
+
* union at build time from the merged contract, so inside the layer it is
|
|
6
|
+
* the foundation contract (`@zoobzio/icons`) and inside an app it is that
|
|
7
|
+
* contract plus the app's own aliases. The wrappers' defaults and an
|
|
8
|
+
* app's own `icon` fields are checked against the same names.
|
|
9
|
+
*/
|
|
10
|
+
export type IconAlias = Alias;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IconAlias } from "../types/icon";
|
|
2
|
+
|
|
3
|
+
import { EDITOR_TOOL_ICONS } from "../constants/editor";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The icon of an editor tool, by its key. A heading tool's key carries its
|
|
7
|
+
* level (`heading-2`), and every level draws the one `heading` icon.
|
|
8
|
+
*/
|
|
9
|
+
export const toolIcon = (key: string): IconAlias | undefined =>
|
|
10
|
+
EDITOR_TOOL_ICONS[/^heading-\d+$/.test(key) ? "heading" : key];
|
|
@@ -29,6 +29,7 @@ export const COMPONENTS = [
|
|
|
29
29
|
"multi-select",
|
|
30
30
|
"pagination",
|
|
31
31
|
"popover",
|
|
32
|
+
"primitive",
|
|
32
33
|
"radio",
|
|
33
34
|
"range-calendar",
|
|
34
35
|
"rich-text",
|
|
@@ -48,19 +49,42 @@ export const COMPONENTS = [
|
|
|
48
49
|
"tree",
|
|
49
50
|
] as const;
|
|
50
51
|
|
|
51
|
-
// The components the layer wraps
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
52
|
+
// The components the layer wraps through `wrap` of @zoobzio/vue: one holds
|
|
53
|
+
// a `link` part the layer lays `NuxtLink` under, draws icons in its slots
|
|
54
|
+
// by default, or renders another wrapped component through a part's `as`.
|
|
55
|
+
// These resolve to `app/components/<name>.ts` instead of @zoobzio/vue, so
|
|
56
|
+
// `#components` serves the Nuxt version only; a wrapper is typed as the
|
|
57
|
+
// vue component, so no separate declaration is needed.
|
|
55
58
|
export const WRAPPED = [
|
|
59
|
+
"accordion",
|
|
56
60
|
"breadcrumb",
|
|
57
61
|
"browser",
|
|
62
|
+
"calendar",
|
|
63
|
+
"checkbox",
|
|
64
|
+
"command",
|
|
65
|
+
"date-filters",
|
|
66
|
+
"date-picker",
|
|
67
|
+
"date-range-picker",
|
|
58
68
|
"directory",
|
|
69
|
+
"editor",
|
|
70
|
+
"facets",
|
|
71
|
+
"file-input",
|
|
72
|
+
"form",
|
|
73
|
+
"form-field",
|
|
59
74
|
"hero",
|
|
75
|
+
"keywords",
|
|
60
76
|
"menu",
|
|
77
|
+
"multi-select",
|
|
78
|
+
"pagination",
|
|
79
|
+
"range-calendar",
|
|
80
|
+
"rich-text",
|
|
81
|
+
"scroller",
|
|
61
82
|
"segmented-control",
|
|
83
|
+
"select",
|
|
62
84
|
"table",
|
|
63
85
|
"tabs",
|
|
86
|
+
"tags-input",
|
|
87
|
+
"toast",
|
|
64
88
|
"tree",
|
|
65
89
|
] as const satisfies readonly (typeof COMPONENTS)[number][];
|
|
66
90
|
|
|
@@ -116,6 +140,7 @@ export const LAYER = {
|
|
|
116
140
|
"composables/log": ["useLogger"],
|
|
117
141
|
"composables/notification": ["useNotifications"],
|
|
118
142
|
"composables/request": ["useRequest", "useLazyRequest"],
|
|
143
|
+
"constants/editor": ["EDITOR_TOOL_ICONS"],
|
|
119
144
|
"constants/error": [
|
|
120
145
|
"ERROR_DEFAULT_STATUS_CODE",
|
|
121
146
|
"ERROR_NOT_FOUND_STATUS_CODE",
|
|
@@ -138,7 +163,9 @@ export const LAYER = {
|
|
|
138
163
|
// Type-only exports, registered the same way so `import type { TableOptions }
|
|
139
164
|
// from "#imports"` resolves. They are re-exported from the virtual module
|
|
140
165
|
// only, never declared global, so the DOM `Notification` and lib
|
|
141
|
-
// `ErrorOptions` are untouched.
|
|
166
|
+
// `ErrorOptions` are untouched. Where the layer widens a vue item type
|
|
167
|
+
// (`MenuItem` with its `icon`), it does so by declaration merging in
|
|
168
|
+
// app.d.ts, so the vue type registered below already carries the field.
|
|
142
169
|
export const LAYER_TYPES = {
|
|
143
170
|
"types/actions": ["Bound"],
|
|
144
171
|
"types/browser": [
|
|
@@ -162,6 +189,7 @@ export const LAYER_TYPES = {
|
|
|
162
189
|
"HookListeners",
|
|
163
190
|
],
|
|
164
191
|
"types/hooks": ["Hooks"],
|
|
192
|
+
"types/icon": ["IconAlias"],
|
|
165
193
|
"types/log": ["LogLevel", "LogLine", "LogEmit", "Logger"],
|
|
166
194
|
"types/notification": ["Notification"],
|
|
167
195
|
"types/request": ["RequestOptions"],
|
|
@@ -195,7 +223,13 @@ export const VUE_TYPES = {
|
|
|
195
223
|
"ButtonShortcut",
|
|
196
224
|
],
|
|
197
225
|
definition: ["Definition", "DefinitionSource"],
|
|
198
|
-
passthrough: [
|
|
226
|
+
passthrough: [
|
|
227
|
+
"Passthrough",
|
|
228
|
+
"PassthroughIter",
|
|
229
|
+
"Rendered",
|
|
230
|
+
"RenderedIter",
|
|
231
|
+
"PT",
|
|
232
|
+
],
|
|
199
233
|
"components/accordion": [
|
|
200
234
|
"AccordionPassthrough",
|
|
201
235
|
"AccordionProps",
|
|
@@ -460,6 +494,7 @@ export const VUE_TYPES = {
|
|
|
460
494
|
"PaginationSlots",
|
|
461
495
|
"PaginationDefinition",
|
|
462
496
|
],
|
|
497
|
+
"components/primitive": ["PrimitiveProps"],
|
|
463
498
|
"components/popover": [
|
|
464
499
|
"PopoverPassthrough",
|
|
465
500
|
"PopoverProps",
|
package/modules/imports/index.ts
CHANGED
|
@@ -38,7 +38,7 @@ export default defineNuxtModule({
|
|
|
38
38
|
addComponent({
|
|
39
39
|
name: pascal(name),
|
|
40
40
|
filePath: wrapped(name, WRAPPED)
|
|
41
|
-
? app(`components/${name}.
|
|
41
|
+
? app(`components/${name}.ts`)
|
|
42
42
|
: resolve(`components/${name}.vue`),
|
|
43
43
|
declarationPath: wrapped(name, WRAPPED)
|
|
44
44
|
? undefined
|
package/nuxt.config.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { defineNuxtConfig } from "nuxt/config";
|
|
3
3
|
|
|
4
|
+
import { prefix } from "@zoobzio/icons";
|
|
5
|
+
import icons from "@zoobzio/icons/config";
|
|
6
|
+
import { sets } from "@zoobzio/icons/sets";
|
|
7
|
+
|
|
4
8
|
export default defineNuxtConfig({
|
|
5
9
|
compatibilityDate: "2025-11-06",
|
|
6
10
|
|
|
11
|
+
modules: ["@icon-sheets/nuxt"],
|
|
12
|
+
|
|
7
13
|
imports: { autoImport: false, scan: false },
|
|
8
14
|
|
|
9
15
|
components: {
|
|
@@ -11,6 +17,11 @@ export default defineNuxtConfig({
|
|
|
11
17
|
transform: { exclude: [/./] },
|
|
12
18
|
},
|
|
13
19
|
|
|
20
|
+
// The foundation icon contract, as the default. An app's own `iconSheets`
|
|
21
|
+
// merges over it, so its aliases join these and a redeclared alias
|
|
22
|
+
// rebinds the foundation's.
|
|
23
|
+
iconSheets: { ...icons, sets, prefix },
|
|
24
|
+
|
|
14
25
|
css: [fileURLToPath(new URL("./app/assets/css/reset.css", import.meta.url))],
|
|
15
26
|
|
|
16
27
|
build: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoobzio/nuxt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Nuxt layer for the foundation design system: the Nuxt wiring over @zoobzio/vue and the headless services (useState stores, hook-bus factories, app shell).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -36,16 +36,18 @@
|
|
|
36
36
|
"./package.json": "./package.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@icon-sheets/nuxt": "0.0.7",
|
|
39
40
|
"@nuxt/kit": "^4.5.0",
|
|
40
41
|
"ltrl-http": "^0.0.20",
|
|
41
42
|
"objectively": "^0.3.0",
|
|
42
43
|
"reka-ui": "^2.6.0",
|
|
43
|
-
"@zoobzio/
|
|
44
|
-
"@zoobzio/
|
|
45
|
-
"@zoobzio/
|
|
46
|
-
"@zoobzio/
|
|
47
|
-
"@zoobzio/table": "0.0.
|
|
48
|
-
"@zoobzio/vue": "0.0.
|
|
44
|
+
"@zoobzio/form": "0.0.11",
|
|
45
|
+
"@zoobzio/browser": "0.0.11",
|
|
46
|
+
"@zoobzio/icons": "0.0.11",
|
|
47
|
+
"@zoobzio/code": "0.0.11",
|
|
48
|
+
"@zoobzio/table": "0.0.11",
|
|
49
|
+
"@zoobzio/vue": "0.0.11",
|
|
50
|
+
"@zoobzio/editor": "0.0.11"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"@codemirror/state": "^6.7.6",
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
BreadcrumbContext,
|
|
4
|
-
BreadcrumbEmits,
|
|
5
|
-
BreadcrumbItem,
|
|
6
|
-
BreadcrumbPassthrough,
|
|
7
|
-
BreadcrumbProps,
|
|
8
|
-
BreadcrumbSlots,
|
|
9
|
-
} from "@zoobzio/vue/types/components/breadcrumb";
|
|
10
|
-
import type { Context } from "@zoobzio/vue/types/context";
|
|
11
|
-
import type { Passthrough } from "@zoobzio/vue/types/passthrough";
|
|
12
|
-
import type { VNodeProps } from "vue";
|
|
13
|
-
|
|
14
|
-
import Core from "@zoobzio/vue/components/breadcrumb.vue";
|
|
15
|
-
|
|
16
|
-
import NuxtLink from "#app/components/nuxt-link";
|
|
17
|
-
import { shallowRef, useAttrs } from "vue";
|
|
18
|
-
import { useContext } from "@zoobzio/vue/composables/context";
|
|
19
|
-
import { useExplicit } from "@zoobzio/vue/composables/explicit";
|
|
20
|
-
import { useForward } from "@zoobzio/vue/composables/forward";
|
|
21
|
-
import { usePassthrough } from "@zoobzio/vue/composables/passthrough";
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<script setup lang="ts" generic="T extends BreadcrumbItem">
|
|
25
|
-
defineOptions({ inheritAttrs: false });
|
|
26
|
-
|
|
27
|
-
const props = defineProps<BreadcrumbProps<T>>();
|
|
28
|
-
|
|
29
|
-
const emit = defineEmits<BreadcrumbEmits<T>>();
|
|
30
|
-
|
|
31
|
-
const slots = defineSlots<BreadcrumbSlots<T>>();
|
|
32
|
-
|
|
33
|
-
const attrs = useAttrs();
|
|
34
|
-
|
|
35
|
-
const explicit = useExplicit(props);
|
|
36
|
-
|
|
37
|
-
const el = shallowRef<{ ctx: Context<BreadcrumbContext<T>> } | null>(null);
|
|
38
|
-
|
|
39
|
-
const pt = usePassthrough<BreadcrumbPassthrough<T>>(() => ({
|
|
40
|
-
pt: props.pt,
|
|
41
|
-
layer: { link: () => ({ as: NuxtLink }) },
|
|
42
|
-
}));
|
|
43
|
-
|
|
44
|
-
const ctx = useContext(() => el.value?.ctx);
|
|
45
|
-
|
|
46
|
-
const Breadcrumb = useForward<
|
|
47
|
-
Passthrough<BreadcrumbProps<T>, BreadcrumbEmits<T>> & VNodeProps
|
|
48
|
-
>({
|
|
49
|
-
component: Core,
|
|
50
|
-
props: () => ({
|
|
51
|
-
...attrs,
|
|
52
|
-
...explicit.value,
|
|
53
|
-
pt: pt.value,
|
|
54
|
-
ref: el,
|
|
55
|
-
onSelect: (item: T) => emit("select", item),
|
|
56
|
-
}),
|
|
57
|
-
slots,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
defineExpose({ ctx });
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<template>
|
|
64
|
-
<Breadcrumb />
|
|
65
|
-
</template>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
BrowserContext,
|
|
4
|
-
BrowserCrumbItem,
|
|
5
|
-
BrowserEmits,
|
|
6
|
-
BrowserProps,
|
|
7
|
-
BrowserSlots,
|
|
8
|
-
} from "@zoobzio/vue/types/components/browser";
|
|
9
|
-
import type { BreadcrumbPassthrough } from "@zoobzio/vue/types/components/breadcrumb";
|
|
10
|
-
import type { BrowserFilesPassthrough } from "@zoobzio/vue/types/components/browser-files";
|
|
11
|
-
import type { Context } from "@zoobzio/vue/types/context";
|
|
12
|
-
import type { Passthrough } from "@zoobzio/vue/types/passthrough";
|
|
13
|
-
import type { VNodeProps } from "vue";
|
|
14
|
-
|
|
15
|
-
import Core from "@zoobzio/vue/components/browser.vue";
|
|
16
|
-
|
|
17
|
-
import NuxtLink from "#app/components/nuxt-link";
|
|
18
|
-
import { shallowRef, useAttrs } from "vue";
|
|
19
|
-
import { useContext } from "@zoobzio/vue/composables/context";
|
|
20
|
-
import { useExplicit } from "@zoobzio/vue/composables/explicit";
|
|
21
|
-
import { useForward } from "@zoobzio/vue/composables/forward";
|
|
22
|
-
import { usePassthrough } from "@zoobzio/vue/composables/passthrough";
|
|
23
|
-
|
|
24
|
-
type BrowserUpdated = BrowserEmits<unknown>["updated"][0];
|
|
25
|
-
type BrowserNavigated = BrowserEmits<unknown>["navigated"][0];
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<script setup lang="ts" generic="T">
|
|
29
|
-
defineOptions({ inheritAttrs: false });
|
|
30
|
-
|
|
31
|
-
const props = defineProps<BrowserProps<T>>();
|
|
32
|
-
|
|
33
|
-
const emit = defineEmits<BrowserEmits<T>>();
|
|
34
|
-
|
|
35
|
-
const slots = defineSlots<BrowserSlots<T>>();
|
|
36
|
-
|
|
37
|
-
const attrs = useAttrs();
|
|
38
|
-
|
|
39
|
-
const explicit = useExplicit(props);
|
|
40
|
-
|
|
41
|
-
const el = shallowRef<{ ctx: Context<BrowserContext<T>> } | null>(null);
|
|
42
|
-
|
|
43
|
-
const files = usePassthrough<BrowserFilesPassthrough<T>>(() => ({
|
|
44
|
-
pt: props.pt?.files,
|
|
45
|
-
layer: { link: () => ({ as: NuxtLink }) },
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
const crumbs = usePassthrough<BreadcrumbPassthrough<BrowserCrumbItem>>(() => ({
|
|
49
|
-
pt: props.pt?.breadcrumb?.pt,
|
|
50
|
-
layer: { link: () => ({ as: NuxtLink }) },
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
const ctx = useContext(() => el.value?.ctx);
|
|
54
|
-
|
|
55
|
-
const Browser = useForward<
|
|
56
|
-
Passthrough<BrowserProps<T>, BrowserEmits<T>> & VNodeProps
|
|
57
|
-
>({
|
|
58
|
-
component: Core,
|
|
59
|
-
props: () => ({
|
|
60
|
-
...attrs,
|
|
61
|
-
...explicit.value,
|
|
62
|
-
pt: {
|
|
63
|
-
...props.pt,
|
|
64
|
-
files: files.value,
|
|
65
|
-
breadcrumb: { ...props.pt?.breadcrumb, pt: crumbs.value },
|
|
66
|
-
},
|
|
67
|
-
ref: el,
|
|
68
|
-
onUpdated: (event: BrowserUpdated) => emit("updated", event),
|
|
69
|
-
onNavigated: (event: BrowserNavigated) => emit("navigated", event),
|
|
70
|
-
}),
|
|
71
|
-
slots,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
defineExpose({ ctx });
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<template>
|
|
78
|
-
<Browser />
|
|
79
|
-
</template>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
DirectoryContext,
|
|
4
|
-
DirectoryEmits,
|
|
5
|
-
DirectoryItem,
|
|
6
|
-
DirectoryPassthrough,
|
|
7
|
-
DirectoryProps,
|
|
8
|
-
DirectorySlots,
|
|
9
|
-
} from "@zoobzio/vue/types/components/directory";
|
|
10
|
-
import type { Context } from "@zoobzio/vue/types/context";
|
|
11
|
-
import type { Passthrough } from "@zoobzio/vue/types/passthrough";
|
|
12
|
-
import type { VNodeProps } from "vue";
|
|
13
|
-
|
|
14
|
-
import Core from "@zoobzio/vue/components/directory.vue";
|
|
15
|
-
|
|
16
|
-
import NuxtLink from "#app/components/nuxt-link";
|
|
17
|
-
import { shallowRef, useAttrs } from "vue";
|
|
18
|
-
import { useContext } from "@zoobzio/vue/composables/context";
|
|
19
|
-
import { useExplicit } from "@zoobzio/vue/composables/explicit";
|
|
20
|
-
import { useForward } from "@zoobzio/vue/composables/forward";
|
|
21
|
-
import { usePassthrough } from "@zoobzio/vue/composables/passthrough";
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<script setup lang="ts" generic="T extends DirectoryItem">
|
|
25
|
-
defineOptions({ inheritAttrs: false });
|
|
26
|
-
|
|
27
|
-
const props = defineProps<DirectoryProps<T>>();
|
|
28
|
-
|
|
29
|
-
const emit = defineEmits<DirectoryEmits<T>>();
|
|
30
|
-
|
|
31
|
-
const slots = defineSlots<DirectorySlots<T>>();
|
|
32
|
-
|
|
33
|
-
const attrs = useAttrs();
|
|
34
|
-
|
|
35
|
-
const explicit = useExplicit(props);
|
|
36
|
-
|
|
37
|
-
const el = shallowRef<{ ctx: Context<DirectoryContext<T>> } | null>(null);
|
|
38
|
-
|
|
39
|
-
const pt = usePassthrough<DirectoryPassthrough<T>>(() => ({
|
|
40
|
-
pt: props.pt,
|
|
41
|
-
layer: { link: () => ({ as: NuxtLink }) },
|
|
42
|
-
}));
|
|
43
|
-
|
|
44
|
-
const ctx = useContext(() => el.value?.ctx);
|
|
45
|
-
|
|
46
|
-
const Directory = useForward<
|
|
47
|
-
Passthrough<DirectoryProps<T>, DirectoryEmits<T>> & VNodeProps
|
|
48
|
-
>({
|
|
49
|
-
component: Core,
|
|
50
|
-
props: () => ({
|
|
51
|
-
...attrs,
|
|
52
|
-
...explicit.value,
|
|
53
|
-
pt: pt.value,
|
|
54
|
-
ref: el,
|
|
55
|
-
onSelect: (item: T) => emit("select", item),
|
|
56
|
-
}),
|
|
57
|
-
slots,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
defineExpose({ ctx });
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<template>
|
|
64
|
-
<Directory />
|
|
65
|
-
</template>
|
package/app/components/hero.vue
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
HeroContext,
|
|
4
|
-
HeroEmits,
|
|
5
|
-
HeroPassthrough,
|
|
6
|
-
HeroProps,
|
|
7
|
-
HeroSlots,
|
|
8
|
-
} from "@zoobzio/vue/types/components/hero";
|
|
9
|
-
import type { Context } from "@zoobzio/vue/types/context";
|
|
10
|
-
import type { Passthrough } from "@zoobzio/vue/types/passthrough";
|
|
11
|
-
import type { VNodeProps } from "vue";
|
|
12
|
-
|
|
13
|
-
import Core from "@zoobzio/vue/components/hero.vue";
|
|
14
|
-
|
|
15
|
-
import NuxtLink from "#app/components/nuxt-link";
|
|
16
|
-
import { shallowRef, useAttrs } from "vue";
|
|
17
|
-
import { useContext } from "@zoobzio/vue/composables/context";
|
|
18
|
-
import { useExplicit } from "@zoobzio/vue/composables/explicit";
|
|
19
|
-
import { useForward } from "@zoobzio/vue/composables/forward";
|
|
20
|
-
import { usePassthrough } from "@zoobzio/vue/composables/passthrough";
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<script setup lang="ts">
|
|
24
|
-
defineOptions({ inheritAttrs: false });
|
|
25
|
-
|
|
26
|
-
const props = defineProps<HeroProps>();
|
|
27
|
-
|
|
28
|
-
const slots = defineSlots<HeroSlots>();
|
|
29
|
-
|
|
30
|
-
const attrs = useAttrs();
|
|
31
|
-
|
|
32
|
-
const explicit = useExplicit(props);
|
|
33
|
-
|
|
34
|
-
const el = shallowRef<{ ctx: Context<HeroContext> } | null>(null);
|
|
35
|
-
|
|
36
|
-
const pt = usePassthrough<HeroPassthrough>(() => ({
|
|
37
|
-
pt: props.pt,
|
|
38
|
-
layer: { link: { as: NuxtLink } },
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
const ctx = useContext(() => el.value?.ctx);
|
|
42
|
-
|
|
43
|
-
const Hero = useForward<Passthrough<HeroProps, HeroEmits> & VNodeProps>({
|
|
44
|
-
component: Core,
|
|
45
|
-
props: () => ({
|
|
46
|
-
...attrs,
|
|
47
|
-
...explicit.value,
|
|
48
|
-
pt: pt.value,
|
|
49
|
-
ref: el,
|
|
50
|
-
}),
|
|
51
|
-
slots,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
defineExpose({ ctx });
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<template>
|
|
58
|
-
<Hero />
|
|
59
|
-
</template>
|