@ulu/frontend-vue 0.2.0-beta.8 → 0.3.0
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/components/collapsible/UluAccordionGroup.vue.d.ts +2 -2
- package/dist/components/collapsible/UluAccordionGroup.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluAccordionGroup.vue.js +22 -19
- package/dist/components/collapsible/UluDropdown.vue.d.ts +1 -1
- package/dist/components/collapsible/UluDropdown.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluDropdown.vue.js +22 -15
- package/dist/components/collapsible/UluModal.vue.d.ts +43 -248
- package/dist/components/collapsible/UluModal.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluModal.vue.js +139 -191
- package/dist/components/collapsible/UluTabGroup.vue.d.ts +2 -0
- package/dist/components/collapsible/UluTabGroup.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluTabGroup.vue.js +23 -14
- package/dist/components/elements/UluAlert.vue.d.ts +29 -144
- package/dist/components/elements/UluAlert.vue.d.ts.map +1 -1
- package/dist/components/elements/UluAlert.vue.js +39 -50
- package/dist/components/elements/UluBadge.vue.d.ts +6 -6
- package/dist/components/elements/UluBadgeStack.vue.d.ts +1 -1
- package/dist/components/elements/UluBadgeStack.vue.d.ts.map +1 -1
- package/dist/components/elements/UluBadgeStack.vue.js +12 -9
- package/dist/components/elements/UluButton.vue.d.ts +47 -177
- package/dist/components/elements/UluButton.vue.d.ts.map +1 -1
- package/dist/components/elements/UluButton.vue.js +59 -72
- package/dist/components/elements/UluButtonVerbose.vue.d.ts +38 -123
- package/dist/components/elements/UluButtonVerbose.vue.d.ts.map +1 -1
- package/dist/components/elements/UluButtonVerbose.vue.js +52 -65
- package/dist/components/elements/UluCallout.vue.d.ts +20 -25
- package/dist/components/elements/UluCallout.vue.d.ts.map +1 -1
- package/dist/components/elements/UluCallout.vue.js +11 -16
- package/dist/components/elements/UluCaptionedFigure.vue.d.ts +25 -0
- package/dist/components/elements/UluCaptionedFigure.vue.d.ts.map +1 -0
- package/dist/components/elements/UluCaptionedFigure.vue.js +48 -0
- package/dist/components/elements/UluCard.vue.d.ts +2 -2
- package/dist/components/elements/UluDefinitionList.vue.d.ts +4 -2
- package/dist/components/elements/UluDefinitionList.vue.d.ts.map +1 -1
- package/dist/components/elements/UluDefinitionList.vue.js +32 -28
- package/dist/components/elements/UluExternalLink.vue.d.ts +2 -2
- package/dist/components/elements/UluImage.vue.d.ts +14 -0
- package/dist/components/elements/UluImage.vue.d.ts.map +1 -0
- package/dist/components/elements/UluImage.vue.js +53 -0
- package/dist/components/elements/UluList.vue.d.ts.map +1 -1
- package/dist/components/elements/UluList.vue.js +14 -13
- package/dist/components/elements/UluOverflowScroller.vue.d.ts +49 -0
- package/dist/components/elements/UluOverflowScroller.vue.d.ts.map +1 -0
- package/dist/components/elements/UluOverflowScroller.vue.js +138 -0
- package/dist/components/elements/UluScrollSlider.vue.d.ts +38 -0
- package/dist/components/elements/UluScrollSlider.vue.d.ts.map +1 -0
- package/dist/components/elements/UluScrollSlider.vue.js +146 -0
- package/dist/components/elements/UluSlider.vue.d.ts +57 -0
- package/dist/components/elements/UluSlider.vue.d.ts.map +1 -0
- package/dist/components/elements/UluSlider.vue.js +277 -0
- package/dist/components/forms/UluFormFile.vue.d.ts +2 -2
- package/dist/components/forms/UluFormRadio.vue.d.ts +4 -4
- package/dist/components/index.d.ts +6 -0
- package/dist/components/layout/UluTitleRail.vue.d.ts +29 -87
- package/dist/components/layout/UluTitleRail.vue.d.ts.map +1 -1
- package/dist/components/layout/UluTitleRail.vue.js +51 -46
- package/dist/components/navigation/UluBreadcrumb.vue.d.ts +27 -68
- package/dist/components/navigation/UluBreadcrumb.vue.d.ts.map +1 -1
- package/dist/components/navigation/UluBreadcrumb.vue.js +51 -54
- package/dist/components/navigation/UluMenu.vue.d.ts +30 -138
- package/dist/components/navigation/UluMenu.vue.d.ts.map +1 -1
- package/dist/components/navigation/UluMenu.vue.js +85 -84
- package/dist/components/navigation/UluMenuStack.vue.d.ts +12 -2
- package/dist/components/navigation/UluMenuStack.vue.d.ts.map +1 -1
- package/dist/components/navigation/UluMenuStack.vue.js +26 -18
- package/dist/components/navigation/UluNavStrip.vue.d.ts +22 -134
- package/dist/components/navigation/UluNavStrip.vue.d.ts.map +1 -1
- package/dist/components/navigation/UluNavStrip.vue.js +43 -31
- package/dist/components/systems/facets/UluFacetsSidebarLayout.vue.js +10 -10
- package/dist/components/systems/facets/useFacets.d.ts +3 -0
- package/dist/components/systems/facets/useFacets.d.ts.map +1 -1
- package/dist/components/systems/facets/useFacets.js +124 -112
- package/dist/components/systems/index.d.ts +0 -3
- package/dist/components/systems/scroll-anchors/UluScrollAnchors.vue.d.ts +2 -2
- package/dist/components/systems/table-sticky/UluTableSticky.vue.d.ts +504 -432
- package/dist/components/systems/table-sticky/UluTableSticky.vue.d.ts.map +1 -1
- package/dist/components/systems/table-sticky/UluTableSticky.vue.js +313 -456
- package/dist/components/systems/table-sticky/UluTableStickyRows.vue.d.ts +40 -31
- package/dist/components/systems/table-sticky/UluTableStickyRows.vue.d.ts.map +1 -1
- package/dist/components/systems/table-sticky/UluTableStickyRows.vue.js +43 -45
- package/dist/components/systems/table-sticky/UluTableStickyTable.vue.d.ts +60 -146
- package/dist/components/systems/table-sticky/UluTableStickyTable.vue.d.ts.map +1 -1
- package/dist/components/systems/table-sticky/UluTableStickyTable.vue.js +156 -175
- package/dist/components/utils/UluAction.vue.d.ts +36 -0
- package/dist/components/utils/UluAction.vue.d.ts.map +1 -0
- package/dist/components/utils/UluAction.vue.js +59 -0
- package/dist/components/utils/UluConditionalText.vue.d.ts +7 -26
- package/dist/components/utils/UluConditionalText.vue.d.ts.map +1 -1
- package/dist/components/utils/UluConditionalText.vue.js +12 -14
- package/dist/components/utils/UluConditionalWrapper.vue.d.ts.map +1 -1
- package/dist/components/utils/UluConditionalWrapper.vue.js +11 -9
- package/dist/components/utils/UluPlaceholderImage.vue.d.ts +12 -57
- package/dist/components/utils/UluPlaceholderImage.vue.d.ts.map +1 -1
- package/dist/components/utils/UluPlaceholderImage.vue.js +18 -26
- package/dist/components/utils/UluPlaceholderText.vue.d.ts +6 -20
- package/dist/components/utils/UluPlaceholderText.vue.js +12 -14
- package/dist/components/utils/UluRouteAnnouncer.vue.d.ts +9 -58
- package/dist/components/utils/UluRouteAnnouncer.vue.d.ts.map +1 -1
- package/dist/components/utils/UluRouteAnnouncer.vue.js +28 -28
- package/dist/components/visualizations/UluAnimateNumber.vue.d.ts +20 -14
- package/dist/components/visualizations/UluAnimateNumber.vue.d.ts.map +1 -1
- package/dist/components/visualizations/UluAnimateNumber.vue.js +18 -26
- package/dist/components/visualizations/UluProgressCircle.vue.d.ts +2 -2
- package/dist/composables/useModifiers.d.ts +20 -25
- package/dist/composables/useModifiers.d.ts.map +1 -1
- package/dist/index.js +206 -200
- package/dist/plugins/modals/UluModalsDisplay.vue.d.ts +3 -12
- package/dist/plugins/modals/UluModalsDisplay.vue.js +24 -45
- package/dist/plugins/modals/index.js +6 -6
- package/dist/plugins/toast/UluToast.vue.d.ts +24 -49
- package/dist/plugins/toast/UluToast.vue.d.ts.map +1 -1
- package/dist/plugins/toast/UluToast.vue.js +68 -77
- package/dist/plugins/toast/UluToastDisplay.vue.d.ts +1 -9
- package/dist/plugins/toast/UluToastDisplay.vue.js +27 -35
- package/dist/plugins/toast/defaults.d.ts +40 -35
- package/dist/plugins/toast/defaults.js +2 -2
- package/dist/plugins/toast/index.js +4 -4
- package/dist/plugins/toast/store.d.ts +40 -35
- package/dist/plugins/toast/store.d.ts.map +1 -1
- package/dist/utils/props.d.ts +7 -0
- package/dist/utils/props.d.ts.map +1 -0
- package/dist/utils/props.js +6 -0
- package/lib/components/collapsible/UluAccordionGroup.vue +4 -1
- package/lib/components/collapsible/UluDropdown.vue +5 -1
- package/lib/components/collapsible/UluModal.vue +278 -298
- package/lib/components/collapsible/UluTabGroup.vue +21 -6
- package/lib/components/elements/UluAlert.vue +38 -51
- package/lib/components/elements/UluBadgeStack.vue +4 -1
- package/lib/components/elements/UluButton.vue +105 -129
- package/lib/components/elements/UluButtonVerbose.vue +67 -89
- package/lib/components/elements/UluCallout.vue +15 -19
- package/lib/components/elements/UluCaptionedFigure.vue +40 -0
- package/lib/components/elements/UluDefinitionList.vue +27 -6
- package/lib/components/elements/UluImage.vue +56 -0
- package/lib/components/elements/UluList.vue +1 -0
- package/lib/components/elements/UluOverflowScroller.vue +140 -0
- package/lib/components/elements/UluScrollSlider.vue +150 -0
- package/lib/components/elements/UluSlider.vue +488 -0
- package/lib/components/index.js +10 -0
- package/lib/components/layout/UluTitleRail.vue +55 -48
- package/lib/components/navigation/UluBreadcrumb.vue +29 -34
- package/lib/components/navigation/UluMenu.vue +60 -71
- package/lib/components/navigation/UluMenuStack.vue +6 -1
- package/lib/components/navigation/UluNavStrip.vue +43 -31
- package/lib/components/systems/facets/useFacets.js +33 -17
- package/lib/components/systems/index.js +0 -4
- package/lib/components/systems/table-sticky/UluTableSticky.vue +602 -576
- package/lib/components/systems/table-sticky/UluTableStickyRows.vue +16 -27
- package/lib/components/systems/table-sticky/UluTableStickyTable.vue +95 -96
- package/lib/components/utils/UluAction.vue +81 -0
- package/lib/components/utils/UluConditionalText.vue +13 -16
- package/lib/components/utils/UluConditionalWrapper.vue +5 -1
- package/lib/components/utils/UluPlaceholderImage.vue +44 -46
- package/lib/components/utils/UluPlaceholderText.vue +10 -13
- package/lib/components/utils/UluRouteAnnouncer.vue +59 -47
- package/lib/components/visualizations/UluAnimateNumber.vue +23 -30
- package/lib/composables/useModifiers.js +21 -26
- package/lib/plugins/modals/UluModalsDisplay.vue +44 -45
- package/lib/plugins/toast/UluToast.vue +28 -34
- package/lib/plugins/toast/UluToastDisplay.vue +9 -15
- package/lib/utils/props.js +8 -0
- package/package.json +9 -5
- package/dist/components/systems/slider/UluImageSlideShow.vue.d.ts +0 -130
- package/dist/components/systems/slider/UluImageSlideShow.vue.d.ts.map +0 -1
- package/dist/components/systems/slider/UluImageSlideShow.vue.js +0 -73
- package/dist/components/systems/slider/UluSlideShow.vue.d.ts +0 -205
- package/dist/components/systems/slider/UluSlideShow.vue.d.ts.map +0 -1
- package/dist/components/systems/slider/UluSlideShow.vue.js +0 -292
- package/dist/components/systems/slider/UluSlideShowSlide.vue.d.ts +0 -17
- package/dist/components/systems/slider/UluSlideShowSlide.vue.d.ts.map +0 -1
- package/dist/components/systems/slider/UluSlideShowSlide.vue.js +0 -26
- package/lib/components/systems/slider/UluImageSlideShow.vue +0 -75
- package/lib/components/systems/slider/UluSlideShow.vue +0 -336
- package/lib/components/systems/slider/UluSlideShowSlide.vue +0 -25
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
<template>
|
|
2
3
|
<tr
|
|
3
4
|
v-for="(row, rowIndex) in rows"
|
|
@@ -31,15 +32,6 @@
|
|
|
31
32
|
:isActual="isActual"
|
|
32
33
|
/>
|
|
33
34
|
</template>
|
|
34
|
-
<!--
|
|
35
|
-
<component
|
|
36
|
-
v-else-if="column.component"
|
|
37
|
-
:is="column.component"
|
|
38
|
-
:row="row.data"
|
|
39
|
-
:column="column"
|
|
40
|
-
:rowIndex="rowIndex"
|
|
41
|
-
:index="index"
|
|
42
|
-
/> -->
|
|
43
35
|
<div
|
|
44
36
|
v-else-if="column.html"
|
|
45
37
|
v-html="value({ row, column, rowIndex, isActual, foot })"
|
|
@@ -51,23 +43,20 @@
|
|
|
51
43
|
</tr>
|
|
52
44
|
</template>
|
|
53
45
|
|
|
54
|
-
<script>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false
|
|
70
|
-
}
|
|
46
|
+
<script setup>
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
rows: Array,
|
|
49
|
+
rowColumns: Array,
|
|
50
|
+
columnWidth: String,
|
|
51
|
+
optionalAttr: Function,
|
|
52
|
+
resolveClasses: Function,
|
|
53
|
+
getCellHeaders: Function,
|
|
54
|
+
value: Function,
|
|
55
|
+
isActual: Boolean,
|
|
56
|
+
classes: Object,
|
|
57
|
+
foot: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
71
60
|
}
|
|
72
|
-
};
|
|
61
|
+
});
|
|
73
62
|
</script>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
<template>
|
|
2
3
|
<table
|
|
3
4
|
:class="resolveClasses(classes.table, { isActual })"
|
|
@@ -132,106 +133,104 @@
|
|
|
132
133
|
</table>
|
|
133
134
|
</template>
|
|
134
135
|
|
|
135
|
-
<script>
|
|
136
|
+
<script setup>
|
|
136
137
|
import UluTableStickyRows from "./UluTableStickyRows.vue";
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
|
|
139
|
+
const emit = defineEmits([
|
|
140
|
+
"column-sorted",
|
|
141
|
+
"actual-header-removed",
|
|
142
|
+
"actual-header-added"
|
|
143
|
+
]);
|
|
144
|
+
|
|
145
|
+
const props = defineProps({
|
|
146
|
+
resolveClasses: Function,
|
|
147
|
+
classes: {
|
|
148
|
+
type: Object,
|
|
149
|
+
default: () => ({})
|
|
150
|
+
},
|
|
151
|
+
caption: String,
|
|
152
|
+
idPrefix: String,
|
|
153
|
+
headerRows: {
|
|
154
|
+
type: Array,
|
|
155
|
+
required: true
|
|
156
|
+
},
|
|
157
|
+
rows: Array,
|
|
158
|
+
footerRows: Array,
|
|
159
|
+
rowColumns: Array,
|
|
160
|
+
/**
|
|
161
|
+
* Is the actual table not a clone for sticky headers
|
|
162
|
+
*/
|
|
163
|
+
isActual: {
|
|
164
|
+
type: Boolean
|
|
165
|
+
},
|
|
166
|
+
columnWidth: {
|
|
167
|
+
type: String
|
|
141
168
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
headerRows: {
|
|
151
|
-
type: Array,
|
|
152
|
-
required: true
|
|
153
|
-
},
|
|
154
|
-
rows: Array,
|
|
155
|
-
footerRows: Array,
|
|
156
|
-
rowColumns: Array,
|
|
157
|
-
/**
|
|
158
|
-
* Is the actual table not a clone for sticky headers
|
|
159
|
-
*/
|
|
160
|
-
isActual: {
|
|
161
|
-
type: Boolean
|
|
162
|
-
},
|
|
163
|
-
columnWidth: {
|
|
164
|
-
type: String
|
|
165
|
-
},
|
|
166
|
-
/**
|
|
167
|
-
* Optional user overridden value getter (for rows)
|
|
168
|
-
* @param {Object} row The current row
|
|
169
|
-
* @param {Object} column The current column in the row
|
|
170
|
-
*/
|
|
171
|
-
getRowValue: {
|
|
172
|
-
type: Function,
|
|
173
|
-
default: ({ row, column }) => row[column.key]
|
|
174
|
-
},
|
|
175
|
-
/**
|
|
176
|
-
* Optional user overridden value getter (for rows)
|
|
177
|
-
* @param {Object} row The current row
|
|
178
|
-
* @param {Object} column The current column in the row
|
|
179
|
-
*/
|
|
180
|
-
getColumnTitle: {
|
|
181
|
-
type: Function,
|
|
182
|
-
default: ({ column }) => column.title
|
|
183
|
-
},
|
|
169
|
+
/**
|
|
170
|
+
* Optional user overridden value getter (for rows)
|
|
171
|
+
* @param {Object} row The current row
|
|
172
|
+
* @param {Object} column The current column in the row
|
|
173
|
+
*/
|
|
174
|
+
getRowValue: {
|
|
175
|
+
type: Function,
|
|
176
|
+
default: ({ row, column }) => row[column.key]
|
|
184
177
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Optional user overridden value getter (for rows)
|
|
180
|
+
* @param {Object} row The current row
|
|
181
|
+
* @param {Object} column The current column in the row
|
|
182
|
+
*/
|
|
183
|
+
getColumnTitle: {
|
|
184
|
+
type: Function,
|
|
185
|
+
default: ({ column }) => column.title
|
|
189
186
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const headerRefs = {};
|
|
190
|
+
|
|
191
|
+
const handleSortFocus = (column, isFocused) => {
|
|
192
|
+
if (props.isActual) {
|
|
193
|
+
column.sortFocused = isFocused;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const addHeaderRef = (column, el) => {
|
|
198
|
+
if (!props.isActual || !el) return;
|
|
199
|
+
const { id } = column;
|
|
200
|
+
const old = headerRefs[id];
|
|
201
|
+
if (old) {
|
|
202
|
+
emit("actual-header-removed", old);
|
|
203
|
+
}
|
|
204
|
+
emit("actual-header-added", el);
|
|
205
|
+
headerRefs[id] = el;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const optionalAttr = (val) => {
|
|
209
|
+
return val ? val : null;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const value = ({ row, column, rowIndex }) => {
|
|
213
|
+
const valueFn = column.value;
|
|
214
|
+
// Column has value function, pass to user
|
|
215
|
+
if (valueFn) {
|
|
216
|
+
return valueFn({ row: row.data, column, rowIndex });
|
|
217
|
+
} else {
|
|
218
|
+
// added .value to work with data. Should refactor depending on what we need
|
|
219
|
+
return props.getRowValue({ row: row.data, column, rowIndex });
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const getCellHeaders = (column, rowIndex) => {
|
|
224
|
+
const headers = column.headers.join(" ");
|
|
225
|
+
const rowHeaders = column.getRowHeaders(rowIndex);
|
|
226
|
+
const s = rowHeaders.length ? " " : "";
|
|
227
|
+
return `${ headers }${ s }${ rowHeaders }`;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const getHeaderHeaders = (column) => {
|
|
231
|
+
const headersArray = column.headers.filter(id => id !== column.id);
|
|
232
|
+
if (headersArray.length) {
|
|
233
|
+
return headersArray.join(" ");
|
|
235
234
|
}
|
|
236
235
|
};
|
|
237
236
|
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="resolvedElement"
|
|
4
|
+
v-bind="resolvedAttrs"
|
|
5
|
+
>
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</component>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { computed } from 'vue';
|
|
12
|
+
import { RouterLink } from 'vue-router';
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
/**
|
|
16
|
+
* Router link target.
|
|
17
|
+
*/
|
|
18
|
+
to: [String, Object],
|
|
19
|
+
/**
|
|
20
|
+
* Alternative to 'to' (used in some legacy or specific data structures like UluMenu items).
|
|
21
|
+
*/
|
|
22
|
+
path: String,
|
|
23
|
+
/**
|
|
24
|
+
* Standard URL for native anchor tags.
|
|
25
|
+
*/
|
|
26
|
+
href: String,
|
|
27
|
+
/**
|
|
28
|
+
* Target attribute for anchor tags (e.g. '_blank').
|
|
29
|
+
*/
|
|
30
|
+
target: String,
|
|
31
|
+
/**
|
|
32
|
+
* Download attribute for anchor tags.
|
|
33
|
+
*/
|
|
34
|
+
download: [Boolean, String],
|
|
35
|
+
/**
|
|
36
|
+
* Optional explicit element to use (e.g., if you need 'div' or 'span' instead of a button).
|
|
37
|
+
*/
|
|
38
|
+
element: String,
|
|
39
|
+
/**
|
|
40
|
+
* Vue Router active class override.
|
|
41
|
+
*/
|
|
42
|
+
activeClass: String,
|
|
43
|
+
/**
|
|
44
|
+
* Vue Router exact active class override.
|
|
45
|
+
*/
|
|
46
|
+
exactActiveClass: String,
|
|
47
|
+
/**
|
|
48
|
+
* Allows passing 'click' as a prop to signify this is an action (used in UluMenu data objects).
|
|
49
|
+
* Note: The actual @click listener should be attached via fallthrough attrs, this is just for logic routing.
|
|
50
|
+
*/
|
|
51
|
+
click: Function
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const resolvedElement = computed(() => {
|
|
55
|
+
if (props.element) return props.element;
|
|
56
|
+
if (props.to || props.path) return RouterLink;
|
|
57
|
+
if (props.href) return "a";
|
|
58
|
+
return "button";
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const resolvedAttrs = computed(() => {
|
|
62
|
+
const attrs = {};
|
|
63
|
+
|
|
64
|
+
if (props.to || props.path) {
|
|
65
|
+
attrs.to = props.to || props.path;
|
|
66
|
+
if (props.activeClass) attrs.activeClass = props.activeClass;
|
|
67
|
+
if (props.exactActiveClass) attrs.exactActiveClass = props.exactActiveClass;
|
|
68
|
+
} else if (props.href) {
|
|
69
|
+
attrs.href = props.href;
|
|
70
|
+
if (props.target) attrs.target = props.target;
|
|
71
|
+
if (props.download) {
|
|
72
|
+
attrs.download = typeof props.download === "string" ? props.download : true;
|
|
73
|
+
}
|
|
74
|
+
} else if (!props.element || props.element === "button") {
|
|
75
|
+
// It's a button, ensure it doesn't accidentally submit forms unless requested
|
|
76
|
+
attrs.type = "button";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return attrs;
|
|
80
|
+
});
|
|
81
|
+
</script>
|
|
@@ -5,24 +5,21 @@
|
|
|
5
5
|
</component>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
|
-
<script>
|
|
8
|
+
<script setup>
|
|
9
9
|
/**
|
|
10
10
|
* Print out text if set (has value)
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
type: String,
|
|
24
|
-
default: "p"
|
|
25
|
-
}
|
|
12
|
+
defineProps({
|
|
13
|
+
/**
|
|
14
|
+
* Text to print in element
|
|
15
|
+
*/
|
|
16
|
+
text: [String, Number, Array, Object],
|
|
17
|
+
/**
|
|
18
|
+
* Element type to render (ie. h1, h2, p, etc)
|
|
19
|
+
*/
|
|
20
|
+
element: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "p"
|
|
26
23
|
}
|
|
27
|
-
}
|
|
24
|
+
});
|
|
28
25
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component v-if="!unwrapped" :is="is">
|
|
2
|
+
<component v-if="!unwrapped" :is="is" v-bind="$attrs">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</component>
|
|
5
5
|
<template v-else>
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script setup>
|
|
11
|
+
defineOptions({
|
|
12
|
+
inheritAttrs: false
|
|
13
|
+
});
|
|
14
|
+
|
|
11
15
|
defineProps({
|
|
12
16
|
/**
|
|
13
17
|
* The underlying component or HTML tag to render.
|
|
@@ -1,53 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<img :src="src" :alt="alt">
|
|
3
3
|
</template>
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from 'vue';
|
|
5
7
|
import { randomInt } from "@ulu/utils/random.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
default: "300"
|
|
16
|
-
},
|
|
17
|
-
/**
|
|
18
|
-
* Height of the image
|
|
19
|
-
*/
|
|
20
|
-
height: {
|
|
21
|
-
type: [String, Number],
|
|
22
|
-
default: "400"
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
* Alt text for placeholder image
|
|
26
|
-
*/
|
|
27
|
-
alt: String,
|
|
28
|
-
/**
|
|
29
|
-
* Random size
|
|
30
|
-
*/
|
|
31
|
-
random: Boolean
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
imageId: String,
|
|
11
|
+
/**
|
|
12
|
+
* Width of the image
|
|
13
|
+
*/
|
|
14
|
+
width: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
default: "300"
|
|
32
17
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Height of the image
|
|
20
|
+
*/
|
|
21
|
+
height: {
|
|
22
|
+
type: [String, Number],
|
|
23
|
+
default: "400"
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Alt text for placeholder image
|
|
27
|
+
*/
|
|
28
|
+
alt: String,
|
|
29
|
+
/**
|
|
30
|
+
* Random size
|
|
31
|
+
*/
|
|
32
|
+
random: Boolean
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const size = computed(() => {
|
|
36
|
+
if (props.random) {
|
|
37
|
+
return {
|
|
38
|
+
width: randomInt(500, 1000),
|
|
39
|
+
height: randomInt(500, 1000),
|
|
40
|
+
};
|
|
41
|
+
} else {
|
|
42
|
+
return { width: props.width, height: props.height };
|
|
51
43
|
}
|
|
52
|
-
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const src = computed(() => {
|
|
47
|
+
const { width, height } = size.value;
|
|
48
|
+
const id = props.imageId ? `id/${ props.imageId }/` : "";
|
|
49
|
+
return `https://picsum.photos/${ id }${ width }/${ height }`;
|
|
50
|
+
});
|
|
53
51
|
</script>
|
|
@@ -8,18 +8,15 @@
|
|
|
8
8
|
</component>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: Number,
|
|
17
|
-
default: 1
|
|
18
|
-
},
|
|
19
|
-
element: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "p"
|
|
22
|
-
}
|
|
11
|
+
<script setup>
|
|
12
|
+
defineProps({
|
|
13
|
+
amount: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 1
|
|
23
16
|
},
|
|
24
|
-
|
|
17
|
+
element: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "p"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
25
22
|
</script>
|
|
@@ -20,44 +20,62 @@
|
|
|
20
20
|
</p>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* Function to retrieve routes title
|
|
48
|
-
*/
|
|
49
|
-
getTitle: {
|
|
50
|
-
type: Function,
|
|
51
|
-
default: (route) => route.meta?.title
|
|
52
|
-
}
|
|
23
|
+
<script setup>
|
|
24
|
+
import { ref, computed, watch, nextTick } from 'vue';
|
|
25
|
+
import { useRoute } from 'vue-router';
|
|
26
|
+
import { getRouteTitle } from '../../utils/router.js';
|
|
27
|
+
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
/**
|
|
30
|
+
* Allow user to bypass this functionality
|
|
31
|
+
* - Function should return true if the page should be announced
|
|
32
|
+
* - Function is passed (to, from, $route) => {}
|
|
33
|
+
* - to/from are path strings
|
|
34
|
+
*/
|
|
35
|
+
validator: {
|
|
36
|
+
type: Function,
|
|
37
|
+
default: () => true
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Array of paths to exclude
|
|
41
|
+
* - Can be exact path "/about"
|
|
42
|
+
* - Or can be path with wildcard "/about/*" (match all paths under about)
|
|
43
|
+
*/
|
|
44
|
+
exclude: {
|
|
45
|
+
type: Array,
|
|
46
|
+
default: () => []
|
|
53
47
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Function to retrieve routes title
|
|
50
|
+
*/
|
|
51
|
+
getTitle: {
|
|
52
|
+
type: Function,
|
|
53
|
+
default: (route) => getRouteTitle(route)
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const route = useRoute();
|
|
58
|
+
const el = ref(null);
|
|
59
|
+
|
|
60
|
+
const title = computed(() => {
|
|
61
|
+
// Check if route exists to prevent crash if not in router context (though required)
|
|
62
|
+
if (!route) return "";
|
|
63
|
+
const t = props.getTitle(route);
|
|
64
|
+
if (!t) {
|
|
65
|
+
console.warn("RouteAnnouncer: No page title!");
|
|
66
|
+
}
|
|
67
|
+
return t;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
if (route) {
|
|
71
|
+
watch(
|
|
72
|
+
() => route.path,
|
|
73
|
+
async (to, from) => {
|
|
74
|
+
if (route.hash) {
|
|
57
75
|
return;
|
|
58
76
|
}
|
|
59
|
-
const isValid =
|
|
60
|
-
const isExcluded =
|
|
77
|
+
const isValid = props.validator(to, from, route);
|
|
78
|
+
const isExcluded = props.exclude.some(ex => {
|
|
61
79
|
// Allow wildcard at end to exclude entire sections, etc
|
|
62
80
|
if (ex.endsWith("*")) {
|
|
63
81
|
return to.startsWith(ex.slice(0, ex.length - 1));
|
|
@@ -66,18 +84,12 @@
|
|
|
66
84
|
}
|
|
67
85
|
});
|
|
68
86
|
if (isValid && !isExcluded) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
computed: {
|
|
74
|
-
title() {
|
|
75
|
-
const title = this.getTitle(this.$route);
|
|
76
|
-
if (!title) {
|
|
77
|
-
console.warn("RouteAnnouncer: No page title!");
|
|
87
|
+
await nextTick();
|
|
88
|
+
el.value?.focus();
|
|
78
89
|
}
|
|
79
|
-
return title;
|
|
80
90
|
}
|
|
81
|
-
|
|
82
|
-
}
|
|
91
|
+
);
|
|
92
|
+
} else {
|
|
93
|
+
console.error("RouteAnnouncer: No route found (install vue-router).");
|
|
94
|
+
}
|
|
83
95
|
</script>
|