@ulu/frontend-vue 0.1.0-beta.17 → 0.1.0-beta.19
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/dist/{breakpoints-Cd3pu0Is.js → breakpoints-yajtVs6n.js} +1 -1
- package/dist/frontend-vue.js +7 -6
- package/dist/{index-Cdy3vpXx.js → index-RLrfaaN1.js} +1677 -1593
- package/lib/components/elements/UluBadge.vue +27 -28
- package/lib/components/elements/UluBadgeStack.vue +8 -13
- package/lib/components/elements/UluDefinitionList.vue +14 -17
- package/lib/components/elements/UluExternalLink.vue +21 -27
- package/lib/components/elements/UluIcon.vue +11 -1
- package/lib/components/elements/UluList.vue +53 -55
- package/lib/components/elements/UluSpokeSpinner.vue +12 -18
- package/lib/components/elements/UluTag.vue +35 -35
- package/lib/components/forms/UluCheckboxMenu.vue +32 -31
- package/lib/components/forms/UluFileDisplay.vue +40 -31
- package/lib/components/forms/UluFormFile.vue +22 -24
- package/lib/components/forms/UluFormMessage.vue +7 -10
- package/lib/components/forms/UluFormSelect.vue +16 -16
- package/lib/components/forms/UluFormText.vue +15 -15
- package/lib/components/forms/UluSearchForm.vue +8 -10
- package/lib/components/navigation/UluMenu.vue +2 -2
- package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +2 -1
- package/lib/components/systems/slider/UluImageSlideShow.vue +1 -1
- package/lib/components/systems/slider/UluSlideShow.vue +8 -3
- package/lib/components/systems/table-sticky/UluTableSticky.vue +7 -7
- package/lib/components/systems/table-sticky/UluTableStickyTable.vue +3 -3
- package/lib/index.js +1 -0
- package/lib/plugins/core/index.js +4 -1
- package/lib/plugins/toast/UluToast.vue +1 -1
- package/lib/utils/index.js +2 -0
- package/lib/utils/{vue-router.js → router.js} +46 -11
- package/package.json +7 -8
- package/types/index.d.ts +1 -0
- package/types/plugins/core/index.d.ts.map +1 -1
- package/types/utils/index.d.ts +3 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/router.d.ts +126 -0
- package/types/utils/router.d.ts.map +1 -0
- package/lib/utils/placeholder.js +0 -6
|
@@ -3,18 +3,15 @@
|
|
|
3
3
|
'site-form__error' : error,
|
|
4
4
|
'site-form__warning' : warning
|
|
5
5
|
}">
|
|
6
|
-
<
|
|
7
|
-
<FaIcon v-if="warning" :icon="$site.getIcon('warning')"/>
|
|
6
|
+
<UluIcon v-if="error || warning" :icon="`type:${ error ? 'error' : 'warning' }`" />
|
|
8
7
|
<slot/>
|
|
9
8
|
</p>
|
|
10
9
|
</template>
|
|
11
10
|
|
|
12
|
-
<script>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
};
|
|
11
|
+
<script setup>
|
|
12
|
+
import UluIcon from "../elements/UluIcon.vue";
|
|
13
|
+
defineProps({
|
|
14
|
+
warning: Boolean,
|
|
15
|
+
error: Boolean,
|
|
16
|
+
});
|
|
20
17
|
</script>
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
|
-
<script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
<script setup>
|
|
22
|
+
const getNextId = (() => {
|
|
23
|
+
let count = 0;
|
|
24
|
+
return () => `select-id-${++count}`;
|
|
25
|
+
})();
|
|
26
|
+
|
|
27
|
+
defineProps({
|
|
28
|
+
label: String,
|
|
29
|
+
modelValue: String,
|
|
30
|
+
options: Array,
|
|
31
|
+
labelHidden: Boolean
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
defineEmits(['update:modelValue']);
|
|
35
|
+
|
|
36
|
+
const id = getNextId();
|
|
37
37
|
</script>
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<script>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
<script setup>
|
|
18
|
+
const getNextId = (() => {
|
|
19
|
+
let count = 0;
|
|
20
|
+
return () => `text-input-id-${++count}`;
|
|
21
|
+
})();
|
|
22
|
+
|
|
23
|
+
defineProps({
|
|
24
|
+
label: String,
|
|
25
|
+
modelValue: String,
|
|
26
|
+
labelHidden: Boolean
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
defineEmits(['update:modelValue']);
|
|
30
|
+
|
|
31
|
+
const id = getNextId();
|
|
32
32
|
</script>
|
|
@@ -13,19 +13,17 @@
|
|
|
13
13
|
class="search-form__submit button button--primary"
|
|
14
14
|
aria-label="Submit Search"
|
|
15
15
|
>
|
|
16
|
-
<
|
|
16
|
+
<UluIcon icon="type:search" />
|
|
17
17
|
</button>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
|
-
<script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
default: "Titles, keyword…"
|
|
28
|
-
}
|
|
21
|
+
<script setup>
|
|
22
|
+
import UluIcon from "../elements/UluIcon.vue";
|
|
23
|
+
defineProps({
|
|
24
|
+
placeholder: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "Titles, keyword…"
|
|
29
27
|
}
|
|
30
|
-
};
|
|
28
|
+
});
|
|
31
29
|
</script>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
/**
|
|
61
61
|
* Fired anytime a item is clicked
|
|
62
62
|
*/
|
|
63
|
-
"
|
|
63
|
+
"item-click"
|
|
64
64
|
],
|
|
65
65
|
props: {
|
|
66
66
|
/**
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
if (item.click) {
|
|
99
99
|
item.click(event);
|
|
100
100
|
}
|
|
101
|
-
this.$emit("
|
|
101
|
+
this.$emit("item-click", { item, event });
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { SECTIONS, REGISTER, UNREGISTER } from "./symbols.js";
|
|
11
11
|
export default {
|
|
12
12
|
name: "ScrollAnchors",
|
|
13
|
+
emits: ["section-change"],
|
|
13
14
|
props: {
|
|
14
15
|
firstItemActive: Boolean,
|
|
15
16
|
/**
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
} else if (lastExiting && section.active) {
|
|
98
99
|
removeActive();
|
|
99
100
|
}
|
|
100
|
-
this.$emit("
|
|
101
|
+
this.$emit("section-change", {
|
|
101
102
|
section,
|
|
102
103
|
sections,
|
|
103
104
|
active: isIntersecting
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
@click="previous"
|
|
51
51
|
:disabled="!canScrollLeft"
|
|
52
52
|
>
|
|
53
|
-
<
|
|
53
|
+
<UluIcon class="slideshow__control-icon" icon="type:next"/>
|
|
54
54
|
</button>
|
|
55
55
|
</li>
|
|
56
56
|
<li class="slideshow__controls-item slideshow__controls-item--next">
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
@click="next"
|
|
61
61
|
:disabled="!canScrollRight"
|
|
62
62
|
>
|
|
63
|
-
<
|
|
63
|
+
<UluIcon class="slideshow__control-icon" icon="type:previous" />
|
|
64
64
|
</button>
|
|
65
65
|
</li>
|
|
66
66
|
</ul>
|
|
@@ -97,8 +97,13 @@
|
|
|
97
97
|
</template>
|
|
98
98
|
|
|
99
99
|
<script>
|
|
100
|
+
import UluIcon from "../../elements/UluIcon.vue";
|
|
100
101
|
export default {
|
|
101
102
|
name: 'SlideShow',
|
|
103
|
+
emits: ['slide-change'],
|
|
104
|
+
components: {
|
|
105
|
+
UluIcon
|
|
106
|
+
},
|
|
102
107
|
props: {
|
|
103
108
|
/**
|
|
104
109
|
* Should slides be focusable by tab key
|
|
@@ -278,7 +283,7 @@
|
|
|
278
283
|
this.$nextTick(() => {
|
|
279
284
|
const slide = this.getSlideByElement(entry.target);
|
|
280
285
|
slide.active = entry.isIntersecting;
|
|
281
|
-
this.$emit('
|
|
286
|
+
this.$emit('slide-change', { slide, track, nav });
|
|
282
287
|
});
|
|
283
288
|
});
|
|
284
289
|
};
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
pointerEvents: sizesCalculated ? 'auto' : 'none',
|
|
44
44
|
width: tableWidth
|
|
45
45
|
}"
|
|
46
|
-
@
|
|
46
|
+
@column-sorted="applySort"
|
|
47
47
|
>
|
|
48
48
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
49
49
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
opacity: headerOpacityX,
|
|
67
67
|
pointerEvents: headerVisibleX ? 'auto' : 'none'
|
|
68
68
|
}"
|
|
69
|
-
@
|
|
69
|
+
@column-sorted="applySort"
|
|
70
70
|
>
|
|
71
71
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
72
72
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -138,9 +138,9 @@
|
|
|
138
138
|
:getRowValue="getRowValue"
|
|
139
139
|
:getColumnTitle="getColumnTitle"
|
|
140
140
|
@vue:mounted="tableReady"
|
|
141
|
-
@
|
|
142
|
-
@
|
|
143
|
-
@
|
|
141
|
+
@actual-header-removed="headerRemoved"
|
|
142
|
+
@actual-header-added="headerAdded"
|
|
143
|
+
@column-sorted="applySort"
|
|
144
144
|
>
|
|
145
145
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
146
146
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
opacity: headerOpacityX,
|
|
168
168
|
pointerEvents: headerVisibleX ? 'auto' : 'none'
|
|
169
169
|
}"
|
|
170
|
-
@
|
|
170
|
+
@column-sorted="applySort"
|
|
171
171
|
>
|
|
172
172
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
173
173
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
} else {
|
|
444
444
|
column.sortApplied = true;
|
|
445
445
|
}
|
|
446
|
-
this.$emit("
|
|
446
|
+
this.$emit("column-sort", column);
|
|
447
447
|
},
|
|
448
448
|
onColumnResize() {
|
|
449
449
|
if (this.sizesPainted) {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
:class="{
|
|
51
51
|
'table-sticky__sort-button--focused' : column.sortFocused,
|
|
52
52
|
}"
|
|
53
|
-
@click="$emit('
|
|
53
|
+
@click="$emit('column-sorted', column)"
|
|
54
54
|
@focus="handleSortFocus(column, true)"
|
|
55
55
|
@blur="handleSortFocus(column, false)"
|
|
56
56
|
:aria-pressed="column.sortApplied ? 'true' : 'false'"
|
|
@@ -199,9 +199,9 @@
|
|
|
199
199
|
const { id } = column;
|
|
200
200
|
const old = headerRefs[id];
|
|
201
201
|
if (old) {
|
|
202
|
-
this.$emit("
|
|
202
|
+
this.$emit("actual-header-removed", old);
|
|
203
203
|
}
|
|
204
|
-
this.$emit("
|
|
204
|
+
this.$emit("actual-header-added", el);
|
|
205
205
|
headerRefs[id] = el;
|
|
206
206
|
},
|
|
207
207
|
/**
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,10 @@ const defaults = {
|
|
|
22
22
|
resizeBoth: "fas fa-grip",
|
|
23
23
|
ellipsis: "fas fa-ellipsis",
|
|
24
24
|
pathSeparator: "fas fa-chevron-right",
|
|
25
|
-
image: "fas fa-image"
|
|
25
|
+
image: "fas fa-image",
|
|
26
|
+
file: "fas fa-file",
|
|
27
|
+
next: "fas fa-chevron-left",
|
|
28
|
+
previous: "fas fa-chevron-right"
|
|
26
29
|
}
|
|
27
30
|
};
|
|
28
31
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
<div v-if="toast.icon || $slots.icon" class="toast__icon" :class="classes.icon">
|
|
15
15
|
<slot name="icon" :toast="toast">
|
|
16
|
-
<
|
|
16
|
+
<UluIcon v-if="toast.icon" :icon="toast.icon"/>
|
|
17
17
|
</slot>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="toast__content" :class="classes.content">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This Module Creates Menus from route or router config
|
|
3
3
|
* - Note: Functions prefixed with "$" work with $route objects (running application, provided by vue-router ie $router, useRoute, etc),
|
|
4
|
-
* @module
|
|
4
|
+
* @module router-utils
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -21,21 +21,56 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export function createBaseMenu(routes, options) {
|
|
23
23
|
const defaults = {
|
|
24
|
-
qualifier
|
|
24
|
+
qualifier(route, parentPath) {
|
|
25
|
+
if (!parentPath) {
|
|
26
|
+
return isStaticBaseRoute(route);
|
|
27
|
+
} else {
|
|
28
|
+
return isStaticRoute(route);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
25
31
|
sort: sortByWeight,
|
|
26
|
-
item: {}
|
|
32
|
+
item: {},
|
|
33
|
+
includeChildren: false
|
|
27
34
|
};
|
|
28
35
|
const opts = Object.assign({}, defaults, options);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const getItemPath = (r, parentPath) => parentPath ? `${ parentPath }/${ r.path }` : r.path;
|
|
37
|
+
const toMenuItems = (currentRoutes, parentPath = null) => {
|
|
38
|
+
return currentRoutes
|
|
39
|
+
.filter(r => opts.qualifier(r, parentPath))
|
|
40
|
+
.map(r => {
|
|
41
|
+
// Need to grab meta from child but use the parent path
|
|
42
|
+
const menuRoute = r.children ? getChildIndexRoute(r.children) : r;
|
|
43
|
+
const children = r.children ? r.children.filter(child => child.path !== "") : false;
|
|
44
|
+
const item = createMenuItem(menuRoute, getItemPath(r, parentPath), opts.item);
|
|
45
|
+
if (opts.includeChildren && children.length) {
|
|
46
|
+
item.children = toMenuItems(children, item.path);
|
|
47
|
+
}
|
|
48
|
+
return item;
|
|
49
|
+
})
|
|
50
|
+
.sort(opts.sort);
|
|
51
|
+
};
|
|
52
|
+
return toMenuItems(routes);
|
|
37
53
|
}
|
|
38
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Returns menu flat (no parent children)
|
|
57
|
+
*/
|
|
58
|
+
export function flattenMenu(menu) {
|
|
59
|
+
function flatten(items) {
|
|
60
|
+
const result = [];
|
|
61
|
+
for (const item of items) {
|
|
62
|
+
const newItem = { ...item };
|
|
63
|
+
delete newItem.children;
|
|
64
|
+
result.push(newItem);
|
|
65
|
+
if (item.children) {
|
|
66
|
+
result.push(...flatten(item.children));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
return flatten(menu);
|
|
72
|
+
}
|
|
73
|
+
|
|
39
74
|
/**
|
|
40
75
|
* Print out a section's menu based on path
|
|
41
76
|
* @param {*} routes All routes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend-vue",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.19",
|
|
4
4
|
"description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"homepage": "https://github.com/Jscherbe/frontend-vue#readme",
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@headlessui/vue": "^1.7.23",
|
|
60
|
-
"@ulu/frontend": "^0.1.0-beta.
|
|
60
|
+
"@ulu/frontend": "^0.1.0-beta.102",
|
|
61
61
|
"vue": "^3.5.17",
|
|
62
62
|
"vue-router": "^4.5.1"
|
|
63
63
|
},
|
|
64
64
|
"optionalDependencies": {
|
|
65
|
-
"gsap": "^3.13.0",
|
|
66
65
|
"fuse.js": "^6.6.2",
|
|
66
|
+
"gsap": "^3.13.0",
|
|
67
67
|
"vue3-dropzone": "^2.2.1"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
77
77
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
|
78
78
|
"@storybook/addon-docs": "^9.1.1",
|
|
79
|
-
"@storybook/addon-links": "^9.1.1",
|
|
80
79
|
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
80
|
+
"@storybook/addon-links": "^9.1.1",
|
|
81
81
|
"@storybook/vue3-vite": "^9.1.1",
|
|
82
|
-
"@ulu/frontend": "^0.1.0-beta.
|
|
82
|
+
"@ulu/frontend": "^0.1.0-beta.102",
|
|
83
83
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
84
84
|
"ollama": "^0.5.16",
|
|
85
85
|
"react": "^19.1.1",
|
|
@@ -87,12 +87,11 @@
|
|
|
87
87
|
"sass-embedded": "^1.89.2",
|
|
88
88
|
"storybook": "^9.1.1",
|
|
89
89
|
"storybook-addon-vue-mdx": "^2.0.2",
|
|
90
|
+
"typescript": "^5.3.3",
|
|
90
91
|
"vite": "^7.0.0",
|
|
91
|
-
"vue-router": "^4.5.1"
|
|
92
|
-
"typescript": "^5.3.3"
|
|
92
|
+
"vue-router": "^4.5.1"
|
|
93
93
|
},
|
|
94
94
|
"volta": {
|
|
95
95
|
"node": "22.17.0"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
|
package/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/core/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/core/index.js"],"names":[],"mappings":"AAiCA,mEAyDC;AA3DD,gCAA0D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Module Creates Menus from route or router config
|
|
3
|
+
* - Note: Functions prefixed with "$" work with $route objects (running application, provided by vue-router ie $router, useRoute, etc),
|
|
4
|
+
* @module router-utils
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Route Menu Item
|
|
8
|
+
* @typedef {Object} RouteMenuItem
|
|
9
|
+
* @property {String} path - Menu item route path
|
|
10
|
+
* @property {String} title - Menu item title
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Get root/base static routes as menu items
|
|
14
|
+
* @param {*} routes Routes to build menu from (not router instance)
|
|
15
|
+
* @param {Object} options Options
|
|
16
|
+
* @param {Object} options.qualifier Callback to qualify as a base route (defaults to isStaticBaseRoute)
|
|
17
|
+
* @param {Object} options.item Options for createMenuItem
|
|
18
|
+
* @returns {Array.<RouteMenuItem>} Array of menu items
|
|
19
|
+
*/
|
|
20
|
+
export function createBaseMenu(routes: any, options: {
|
|
21
|
+
qualifier: any;
|
|
22
|
+
item: any;
|
|
23
|
+
}): Array<RouteMenuItem>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns menu flat (no parent children)
|
|
26
|
+
*/
|
|
27
|
+
export function flattenMenu(menu: any): any;
|
|
28
|
+
/**
|
|
29
|
+
* Print out a section's menu based on path
|
|
30
|
+
* @param {*} routes All routes
|
|
31
|
+
* @param {*} sectionPath Path for section to create menu
|
|
32
|
+
* @param {Object} options Options
|
|
33
|
+
* @param {Boolean} options.includeIndex Include the parent/index in the menu items ie ({ path: "" })
|
|
34
|
+
* @param {Object} options.item Options to be passed to createMenuItem
|
|
35
|
+
* @returns {Array.<RouteMenuItem>} Array of menu items
|
|
36
|
+
*/
|
|
37
|
+
export function createSectionMenu(routes: any, sectionPath: any, options: {
|
|
38
|
+
includeIndex: boolean;
|
|
39
|
+
item: any;
|
|
40
|
+
}): Array<RouteMenuItem>;
|
|
41
|
+
/**
|
|
42
|
+
* For a given route this will return the route that renders. For routes without
|
|
43
|
+
* children this is the route itself for those with children (first child with empty path)
|
|
44
|
+
* @param {Object} route Route object to resolve
|
|
45
|
+
* @returns {Object} Resolved route
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* For a given array of child routes return the index
|
|
49
|
+
* @param {Array} children Children array of routes
|
|
50
|
+
* @returns {Object} Route
|
|
51
|
+
*/
|
|
52
|
+
export function getChildIndexRoute(children: any[]): any;
|
|
53
|
+
/**
|
|
54
|
+
* Creates common menu item structure from route, pulls title and weight from meta (on route or index child)
|
|
55
|
+
* @param {Object} route Route
|
|
56
|
+
* @param {Object} routePath The final path for the menu item
|
|
57
|
+
* @param {Object} options Function to allow alterering the menu item (adding meta, etc)
|
|
58
|
+
* @param {Function} options.modify Function to allow alterering the menu item (adding meta, etc) (args: item, route)
|
|
59
|
+
* @param {Function} options.indexMeta Include the routes index child's meta (merged on top of route meta)
|
|
60
|
+
* @returns {RouteMenuItem} Menu item
|
|
61
|
+
*/
|
|
62
|
+
export function createMenuItem(route: any, routePath: any, options: {
|
|
63
|
+
modify: Function;
|
|
64
|
+
indexMeta: Function;
|
|
65
|
+
}): RouteMenuItem;
|
|
66
|
+
/**
|
|
67
|
+
* Test if route is static (doesn't incude parameters)
|
|
68
|
+
* @param {Object} route Route object to test
|
|
69
|
+
* @returns {Boolean} Whether or not this route is static (not dynamic)
|
|
70
|
+
*/
|
|
71
|
+
export function isStaticRoute(route: any): boolean;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} route Route object to test
|
|
75
|
+
* @returns {Boolean} Whether or not this route is a static base route
|
|
76
|
+
*/
|
|
77
|
+
export function isStaticBaseRoute(route: any): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Function to make normal <a> behave as router links instread of page reload
|
|
80
|
+
* @param {Object} router Router instance (ie src/router) to push routes to
|
|
81
|
+
* @param {Object} event The event object that triggered route change (ie. onclick) pass event object
|
|
82
|
+
*/
|
|
83
|
+
export function nativeLinkRouter(router: any, event: any): void;
|
|
84
|
+
/**
|
|
85
|
+
* Returns the child routes for base route
|
|
86
|
+
* @param {Object} route Route Object
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
export function $getRouteChildren(route: any, parent?: any): any;
|
|
90
|
+
/**
|
|
91
|
+
* Returns the route's parent
|
|
92
|
+
* @param {Object} route Route Object
|
|
93
|
+
* @param {Object} deepest By default this returns the routes parent, if deepest it will return it's base route (top level parent)
|
|
94
|
+
* @return {Object|Null} Parent route, if there is no parent route for the given route this will return null
|
|
95
|
+
*/
|
|
96
|
+
export function $getParentRoute(route: any, deepest: any): any | null;
|
|
97
|
+
/**
|
|
98
|
+
* For a given $route will return all it's children as menu items,
|
|
99
|
+
* using the route's meta.title property for the title. This is for sections only (routes with children)
|
|
100
|
+
* - Useful for dynamic menus (menus within some unknown section) where you don't want to write static paths
|
|
101
|
+
* @param {Object} route Actual $route object
|
|
102
|
+
* @param {Object} options Options
|
|
103
|
+
* @param {Object} options.parent Route parent object, defaults to parent of route
|
|
104
|
+
* @param {Boolean} options.includeIndex Include the parent/index in the menu items ie ({ path: "" })
|
|
105
|
+
* @param {Object} options.item Options for createMenuItem
|
|
106
|
+
* @returns {Array.<RouteMenuItem>} Array of menu items
|
|
107
|
+
*/
|
|
108
|
+
export function $createSectionMenu(route: any, options: {
|
|
109
|
+
parent: any;
|
|
110
|
+
includeIndex: boolean;
|
|
111
|
+
item: any;
|
|
112
|
+
}): Array<RouteMenuItem>;
|
|
113
|
+
/**
|
|
114
|
+
* Route Menu Item
|
|
115
|
+
*/
|
|
116
|
+
export type RouteMenuItem = {
|
|
117
|
+
/**
|
|
118
|
+
* - Menu item route path
|
|
119
|
+
*/
|
|
120
|
+
path: string;
|
|
121
|
+
/**
|
|
122
|
+
* - Menu item title
|
|
123
|
+
*/
|
|
124
|
+
title: string;
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../lib/utils/router.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,uCANW,GAAC,WAET;IAAwB,SAAS;IACT,IAAI;CAC5B,GAAU,KAAK,CAAE,aAAa,CAAC,CAiCjC;AAED;;GAEG;AACH,4CAcC;AAED;;;;;;;;GAQG;AACH,0CAPW,GAAC,eACD,GAAC,WAET;IAAyB,YAAY;IACb,IAAI;CAC5B,GAAU,KAAK,CAAE,aAAa,CAAC,CA6BjC;AAED;;;;;GAKG;AASH;;;;GAIG;AACH,yDAEC;AACD;;;;;;;;GAQG;AACH,oEAJG;IAA0B,MAAM;IACN,SAAS;CACnC,GAAU,aAAa,CAsBzB;AACD;;;;GAIG;AACH,mDAEC;AACD;;;;GAIG;AACH,uDAGC;AACD;;;;GAIG;AACH,gEAUC;AACD;;;;GAIG;AACH,iEAEC;AACD;;;;;GAKG;AACH,2DAFY,UAAW,CAUtB;AAUD;;;;;;;;;;GAUG;AACH,wDALG;IAAwB,MAAM;IACL,YAAY;IACb,IAAI;CAC5B,GAAU,KAAK,CAAE,aAAa,CAAC,CAgBjC"}
|
package/lib/utils/placeholder.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam commodo felis nisi, nec pretium justo varius sit amet. Vestibulum vitae quam in velit scelerisque tincidunt et vitae mauris. Fusce aliquet, ipsum sit amet lacinia euismod, est risus rhoncus ligula, eget egestas urna ligula nec enim. Fusce vulputate ornare ligula ut tempus. Sed accumsan orci sed turpis iaculis, at aliquam nibh rhoncus. Maecenas porta lorem a sem tincidunt, sed tristique ex laoreet. Nullam accumsan metus at lobortis interdum. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam sagittis sem erat, quis fermentum lectus ultrices quis.",
|
|
3
|
-
textSmall: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam commodo felis nisi, nec pretium justo varius sit amet.",
|
|
4
|
-
paragraph: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam commodo felis nisi, nec pretium justo varius sit amet. Vestibulum vitae quam in velit scelerisque tincidunt et vitae mauris. Fusce aliquet, ipsum sit amet lacinia euismod, est risus rhoncus ligula, eget egestas urna ligula nec enim. Fusce vulputate ornare ligula ut tempus. Sed accumsan orci sed turpis iaculis, at aliquam nibh rhoncus. Maecenas porta lorem a sem tincidunt, sed tristique ex laoreet. Nullam accumsan metus at lobortis interdum. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam sagittis sem erat, quis fermentum lectus ultrices quis.</p>",
|
|
5
|
-
paragraphSmall: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam commodo felis nisi, nec pretium justo varius sit amet. Vestibulum vitae quam in velit scelerisque tincidunt et vitae mauris. </p>"
|
|
6
|
-
}
|