@ulu/frontend-vue 0.1.0-beta.2 → 0.1.0-beta.21
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 +113 -2
- package/dist/{breakpoints-ClT9bfZm.js → breakpoints-DOXmgVoG.js} +1 -1
- package/dist/frontend-vue.css +1 -1
- package/dist/frontend-vue.js +75 -73
- package/dist/index-BpmkfeZb.js +6671 -0
- package/lib/components/collapsible/UluAccordion.vue +1 -1
- package/lib/components/collapsible/UluModal.vue +4 -5
- package/lib/components/collapsible/UluOverflowPopover.vue +1 -1
- package/lib/components/elements/UluAlert.vue +1 -2
- package/lib/components/elements/UluBadge.vue +27 -28
- package/lib/components/elements/UluBadgeStack.vue +8 -13
- package/lib/components/elements/UluButton.vue +2 -2
- package/lib/components/elements/UluButtonVerbose.vue +119 -0
- package/lib/components/elements/UluCard.vue +1 -1
- package/lib/components/elements/UluDefinitionList.vue +14 -17
- package/lib/components/elements/UluExternalLink.vue +22 -29
- package/lib/components/elements/UluIcon.vue +22 -17
- 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/index.js +1 -1
- package/lib/components/layout/UluAdaptiveLayout.vue +3 -5
- package/lib/components/layout/UluTitleRail.vue +9 -5
- package/lib/components/layout/UluWhenBreakpoint.vue +71 -77
- package/lib/components/navigation/UluBreadcrumb.vue +1 -2
- package/lib/components/navigation/UluMenu.vue +3 -3
- package/lib/components/navigation/UluPager.vue +102 -0
- package/lib/components/systems/facets/ExampleFacetsWithPagination.vue +119 -0
- package/lib/components/systems/facets/UluFacetsFilters.vue +73 -0
- package/lib/components/systems/facets/UluFacetsList.vue +13 -14
- package/lib/components/systems/facets/UluFacetsResults.vue +57 -0
- package/lib/components/systems/facets/UluFacetsSearch.vue +26 -49
- package/lib/components/systems/facets/UluFacetsSidebarLayout.vue +31 -0
- package/lib/components/systems/facets/UluFacetsSort.vue +45 -0
- package/lib/components/systems/facets/_facets.scss +2 -3
- package/lib/components/systems/facets/_mock-data.js +40 -0
- package/lib/components/systems/facets/useFacets.js +221 -0
- package/lib/components/systems/index.js +10 -2
- package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +2 -1
- package/lib/components/systems/skeleton/UluShowSkeleton.vue +9 -8
- package/lib/components/systems/skeleton/UluSkeletonContent.vue +39 -43
- package/lib/components/systems/skeleton/UluSkeletonMedia.vue +4 -6
- package/lib/components/systems/skeleton/UluSkeletonText.vue +27 -0
- 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 +8 -8
- package/lib/components/systems/table-sticky/UluTableStickyTable.vue +3 -3
- package/lib/composables/index.js +3 -1
- package/lib/composables/useDocumentTitle.js +47 -0
- package/lib/composables/usePageTitle.js +37 -0
- package/lib/composables/usePagination.js +122 -0
- package/lib/composables/useRequiredInject.js +26 -0
- package/lib/index.js +1 -1
- package/lib/meta.js +14 -0
- package/lib/plugins/core/index.js +91 -0
- package/lib/plugins/index.js +1 -0
- package/lib/plugins/toast/UluToast.vue +2 -2
- package/lib/utils/index.js +2 -0
- package/lib/utils/{vue-router.js → router.js} +106 -11
- package/package.json +37 -14
- package/types/components/index.d.ts +2 -0
- package/types/components/index.d.ts.map +1 -0
- package/types/components/systems/facets/_mock-data.d.ts +18 -0
- package/types/components/systems/facets/_mock-data.d.ts.map +1 -0
- package/types/components/systems/facets/useFacets.d.ts +39 -0
- package/types/components/systems/facets/useFacets.d.ts.map +1 -0
- package/types/components/systems/index.d.ts +2 -0
- package/types/components/systems/index.d.ts.map +1 -0
- package/types/components/systems/scroll-anchors/symbols.d.ts +7 -0
- package/types/components/systems/scroll-anchors/symbols.d.ts.map +1 -0
- package/types/composables/index.d.ts +7 -0
- package/types/composables/index.d.ts.map +1 -0
- package/types/composables/useBreakpointManager.d.ts +8 -0
- package/types/composables/useBreakpointManager.d.ts.map +1 -0
- package/types/composables/useDocumentTitle.d.ts +18 -0
- package/types/composables/useDocumentTitle.d.ts.map +1 -0
- package/types/composables/useIcon.d.ts +6 -0
- package/types/composables/useIcon.d.ts.map +1 -0
- package/types/composables/useModifiers.d.ts +69 -0
- package/types/composables/useModifiers.d.ts.map +1 -0
- package/types/composables/usePageTitle.d.ts +19 -0
- package/types/composables/usePageTitle.d.ts.map +1 -0
- package/types/composables/usePagination.d.ts +25 -0
- package/types/composables/usePagination.d.ts.map +1 -0
- package/types/composables/useRequiredInject.d.ts +8 -0
- package/types/composables/useRequiredInject.d.ts.map +1 -0
- package/types/composables/useWindowResize.d.ts +6 -0
- package/types/composables/useWindowResize.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/meta.d.ts +10 -0
- package/types/meta.d.ts.map +1 -0
- package/types/plugins/breakpoints/index.d.ts +2 -0
- package/types/plugins/breakpoints/index.d.ts.map +1 -0
- package/types/plugins/core/index.d.ts +3 -0
- package/types/plugins/core/index.d.ts.map +1 -0
- package/types/plugins/index.d.ts +6 -0
- package/types/plugins/index.d.ts.map +1 -0
- package/types/plugins/modals/api.d.ts +34 -0
- package/types/plugins/modals/api.d.ts.map +1 -0
- package/types/plugins/modals/index.d.ts +28 -0
- package/types/plugins/modals/index.d.ts.map +1 -0
- package/types/plugins/modals/useModals.d.ts +2 -0
- package/types/plugins/modals/useModals.d.ts.map +1 -0
- package/types/plugins/popovers/defaults.d.ts +14 -0
- package/types/plugins/popovers/defaults.d.ts.map +1 -0
- package/types/plugins/popovers/directive.d.ts +8 -0
- package/types/plugins/popovers/directive.d.ts.map +1 -0
- package/types/plugins/popovers/index.d.ts +7 -0
- package/types/plugins/popovers/index.d.ts.map +1 -0
- package/types/plugins/popovers/manager.d.ts +52 -0
- package/types/plugins/popovers/manager.d.ts.map +1 -0
- package/types/plugins/popovers/useFollow.d.ts +31 -0
- package/types/plugins/popovers/useFollow.d.ts.map +1 -0
- package/types/plugins/popovers/utils.d.ts +2 -0
- package/types/plugins/popovers/utils.d.ts.map +1 -0
- package/types/plugins/toast/defaults.d.ts +15 -0
- package/types/plugins/toast/defaults.d.ts.map +1 -0
- package/types/plugins/toast/index.d.ts +5 -0
- package/types/plugins/toast/index.d.ts.map +1 -0
- package/types/plugins/toast/store.d.ts +22 -0
- package/types/plugins/toast/store.d.ts.map +1 -0
- package/types/plugins/toast/useToast.d.ts +2 -0
- package/types/plugins/toast/useToast.d.ts.map +1 -0
- package/types/utils/dom.d.ts +8 -0
- package/types/utils/dom.d.ts.map +1 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/placeholder.d.ts +8 -0
- package/types/utils/placeholder.d.ts.map +1 -0
- package/types/utils/router.d.ts +141 -0
- package/types/utils/router.d.ts.map +1 -0
- package/types/utils/vue-router.d.ts +122 -0
- package/types/utils/vue-router.d.ts.map +1 -0
- package/dist/frontend-vue.umd.cjs +0 -561
- package/dist/index-P5Rwl_Dl.js +0 -7263
- package/lib/components/forms/UluFormDropzone.vue +0 -62
- package/lib/components/systems/facets/UluFacets.vue +0 -380
- package/lib/components/systems/skeleton/UluSkeletonTextInline.vue +0 -9
- package/lib/settings.js +0 -119
- package/lib/utils/placeholder.js +0 -6
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<UluIcon
|
|
27
27
|
v-if="titleIcon"
|
|
28
28
|
class="modal__title-icon"
|
|
29
|
-
:
|
|
29
|
+
:icon="titleIcon"
|
|
30
30
|
/>
|
|
31
31
|
<span class="modal__title-text">{{ title }}</span>
|
|
32
32
|
</slot>
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
<slot name="closeIcon">
|
|
36
36
|
<UluIcon
|
|
37
37
|
class="modal__close-icon"
|
|
38
|
-
|
|
39
|
-
:definition="closeIcon"
|
|
38
|
+
:icon="closeIcon || 'type:close'"
|
|
40
39
|
/>
|
|
41
40
|
</slot>
|
|
42
41
|
</button>
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
</div>
|
|
57
56
|
<button v-if="resizerEnabled" class="modal__resizer" ref="resizer" type="button">
|
|
58
57
|
<slot name="resizerIcon">
|
|
59
|
-
<UluIcon class="modal__resizer-icon" :
|
|
58
|
+
<UluIcon class="modal__resizer-icon" :icon="resizerIcon || resizerIconType" />
|
|
60
59
|
</slot>
|
|
61
60
|
</button>
|
|
62
61
|
</dialog>
|
|
@@ -213,7 +212,7 @@
|
|
|
213
212
|
});
|
|
214
213
|
|
|
215
214
|
const resizerIconType = computed(() => {
|
|
216
|
-
return props.position === 'center' ? 'resizeBoth' : 'resizeHorizontal';
|
|
215
|
+
return props.position === 'center' ? 'type:resizeBoth' : 'type:resizeHorizontal';
|
|
217
216
|
});
|
|
218
217
|
|
|
219
218
|
// Define the internal modifiers object as a computed property (so it can react to changes)
|
|
@@ -26,33 +26,32 @@
|
|
|
26
26
|
</component>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
|
-
<script>
|
|
29
|
+
<script setup>
|
|
30
|
+
import { computed } from "vue";
|
|
30
31
|
import { RouterLink } from "vue-router";
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
};
|
|
32
|
+
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
skeleton: Boolean,
|
|
35
|
+
size: String,
|
|
36
|
+
text: String,
|
|
37
|
+
alt: String,
|
|
38
|
+
type: String,
|
|
39
|
+
click: Function,
|
|
40
|
+
to: [Object, String],
|
|
41
|
+
href: String,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const isInteractive = computed(() => {
|
|
45
|
+
return Boolean(props.to || props.click);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const element = computed(() => {
|
|
49
|
+
const { click, to, href } = props;
|
|
50
|
+
/* eslint-disable */
|
|
51
|
+
return click ? "button" :
|
|
52
|
+
to ? RouterLink :
|
|
53
|
+
href ? "a" :
|
|
54
|
+
"span";
|
|
55
|
+
/* eslint-enable */
|
|
56
|
+
});
|
|
58
57
|
</script>
|
|
@@ -10,18 +10,13 @@
|
|
|
10
10
|
</ul>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script>
|
|
13
|
+
<script setup>
|
|
14
14
|
import UluBadge from "./UluBadge.vue";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Array of props for each badge
|
|
23
|
-
*/
|
|
24
|
-
items: Array
|
|
25
|
-
}
|
|
26
|
-
}
|
|
15
|
+
|
|
16
|
+
defineProps({
|
|
17
|
+
/**
|
|
18
|
+
* Array of props for each badge
|
|
19
|
+
*/
|
|
20
|
+
items: Array
|
|
21
|
+
});
|
|
27
22
|
</script>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<slot name="before"/>
|
|
23
23
|
<UluIcon
|
|
24
24
|
v-if="icon && (iconBefore || iconOnly)"
|
|
25
|
-
:
|
|
25
|
+
:icon="icon"
|
|
26
26
|
class="button__icon"
|
|
27
27
|
/>
|
|
28
28
|
<span v-if="($slots.default || text) && !iconOnly">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</span>
|
|
33
33
|
<UluIcon
|
|
34
34
|
v-if="icon && (!iconBefore && !iconOnly)"
|
|
35
|
-
:
|
|
35
|
+
:icon="icon"
|
|
36
36
|
class="button__icon"
|
|
37
37
|
/>
|
|
38
38
|
<slot name="after"/>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="element"
|
|
4
|
+
class="button-verbose"
|
|
5
|
+
:class="[
|
|
6
|
+
{
|
|
7
|
+
'button-verbose--inline': inline,
|
|
8
|
+
'button-verbose--full-width': fullWidth,
|
|
9
|
+
},
|
|
10
|
+
resolvedModifiers
|
|
11
|
+
]"
|
|
12
|
+
v-bind="attrs"
|
|
13
|
+
>
|
|
14
|
+
<component
|
|
15
|
+
v-if="$slots.title || title"
|
|
16
|
+
:is="titleElement"
|
|
17
|
+
class="button-verbose__title"
|
|
18
|
+
>
|
|
19
|
+
<slot name="title">
|
|
20
|
+
{{ title }}
|
|
21
|
+
</slot>
|
|
22
|
+
</component>
|
|
23
|
+
<span v-if="$slots.default || body" class="button-verbose__body">
|
|
24
|
+
<slot>
|
|
25
|
+
{{ body }}
|
|
26
|
+
</slot>
|
|
27
|
+
</span>
|
|
28
|
+
<UluIcon
|
|
29
|
+
v-if="icon"
|
|
30
|
+
:icon="icon"
|
|
31
|
+
class="button-verbose__icon"
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
/>
|
|
34
|
+
</component>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { RouterLink } from "vue-router";
|
|
39
|
+
import UluIcon from "./UluIcon.vue";
|
|
40
|
+
import { useModifiers } from "../../composables/useModifiers.js";
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: "UluButtonVerbose",
|
|
44
|
+
components: {
|
|
45
|
+
UluIcon
|
|
46
|
+
},
|
|
47
|
+
props: {
|
|
48
|
+
/**
|
|
49
|
+
* The title of the button. Can also be passed via slot.
|
|
50
|
+
*/
|
|
51
|
+
title: String,
|
|
52
|
+
/**
|
|
53
|
+
* Optional element to use for title
|
|
54
|
+
*/
|
|
55
|
+
titleElement: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "strong"
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* The body text of the button. Can also be passed via slot.
|
|
61
|
+
*/
|
|
62
|
+
body: String,
|
|
63
|
+
/**
|
|
64
|
+
* Icon prop, if used will set the icon for the button, will use UluIcon (which uses font-awesome icons conditionally)
|
|
65
|
+
*/
|
|
66
|
+
icon: [String, Array],
|
|
67
|
+
/**
|
|
68
|
+
* If set will use router-link for button component and pass to prop
|
|
69
|
+
*/
|
|
70
|
+
to: [String, Object],
|
|
71
|
+
/**
|
|
72
|
+
* Sets the button to a link with this href
|
|
73
|
+
*/
|
|
74
|
+
href: String,
|
|
75
|
+
/**
|
|
76
|
+
* Set a value for target attribute when button is a link
|
|
77
|
+
*/
|
|
78
|
+
target: String,
|
|
79
|
+
/**
|
|
80
|
+
* Sets the download attribute on the link (passing string [filename] will populate the download attribute, true will just include it as boolean attribute)
|
|
81
|
+
*/
|
|
82
|
+
download: [Boolean, String],
|
|
83
|
+
/**
|
|
84
|
+
* Preset to set inline style
|
|
85
|
+
*/
|
|
86
|
+
inline: Boolean,
|
|
87
|
+
/**
|
|
88
|
+
* Preset to set full-width style
|
|
89
|
+
*/
|
|
90
|
+
fullWidth: Boolean,
|
|
91
|
+
/**
|
|
92
|
+
* Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
|
|
93
|
+
*/
|
|
94
|
+
modifiers: [String, Array]
|
|
95
|
+
},
|
|
96
|
+
setup(props) {
|
|
97
|
+
const { resolvedModifiers } = useModifiers({ props, baseClass: "button-verbose" });
|
|
98
|
+
return { resolvedModifiers };
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
element() {
|
|
102
|
+
return this.to ? RouterLink : this.href ? "a" : "button";
|
|
103
|
+
},
|
|
104
|
+
attrs() {
|
|
105
|
+
const { to, href, download, target } = this;
|
|
106
|
+
const attrs = to ? { to } : href ? { href } : {};
|
|
107
|
+
if (href) {
|
|
108
|
+
if (target) {
|
|
109
|
+
attrs.target = target;
|
|
110
|
+
}
|
|
111
|
+
if (download) {
|
|
112
|
+
attrs.download = typeof download === "string" ? download : true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return attrs;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
</script>
|
|
@@ -19,22 +19,19 @@
|
|
|
19
19
|
</dl>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
|
-
<script>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type: Object,
|
|
36
|
-
default: () => ({})
|
|
37
|
-
}
|
|
22
|
+
<script setup>
|
|
23
|
+
defineProps({
|
|
24
|
+
/**
|
|
25
|
+
* Array of term, and description (props in object)
|
|
26
|
+
* - Can use slots also
|
|
27
|
+
*/
|
|
28
|
+
items: Array,
|
|
29
|
+
/**
|
|
30
|
+
* Classes object for different elements { list, item, term, description }
|
|
31
|
+
*/
|
|
32
|
+
classes: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => ({})
|
|
38
35
|
}
|
|
39
|
-
};
|
|
36
|
+
});
|
|
40
37
|
</script>
|
|
@@ -5,43 +5,36 @@
|
|
|
5
5
|
</span>
|
|
6
6
|
<UluIcon
|
|
7
7
|
class="external-link__icon margin-left-small-x display-inline"
|
|
8
|
-
|
|
9
|
-
:definition="icon"
|
|
8
|
+
:icon="icon || 'type:externalLink'"
|
|
10
9
|
/>
|
|
11
10
|
</a>
|
|
12
11
|
</template>
|
|
13
12
|
|
|
14
|
-
<script>
|
|
13
|
+
<script setup>
|
|
15
14
|
import UluIcon from "./UluIcon.vue";
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* Component for external links (adds icon after link text)
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
defineProps({
|
|
20
|
+
/**
|
|
21
|
+
* Text for link or use slot
|
|
22
|
+
*/
|
|
23
|
+
text: String,
|
|
24
|
+
/**
|
|
25
|
+
* Link href
|
|
26
|
+
*/
|
|
27
|
+
href: String,
|
|
28
|
+
/**
|
|
29
|
+
* Link target
|
|
30
|
+
*/
|
|
31
|
+
target: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "_blank"
|
|
24
34
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Link href
|
|
32
|
-
*/
|
|
33
|
-
href: String,
|
|
34
|
-
/**
|
|
35
|
-
* Link target
|
|
36
|
-
*/
|
|
37
|
-
target: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "_blank"
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* Override default icon
|
|
43
|
-
*/
|
|
44
|
-
icon: String
|
|
45
|
-
}
|
|
46
|
-
};
|
|
35
|
+
/**
|
|
36
|
+
* Override default icon
|
|
37
|
+
*/
|
|
38
|
+
icon: String
|
|
39
|
+
});
|
|
47
40
|
</script>
|
|
@@ -3,67 +3,68 @@
|
|
|
3
3
|
v-if="customIconComponent"
|
|
4
4
|
:is="customIconComponent"
|
|
5
5
|
v-bind="customIconProps"
|
|
6
|
+
:class="commonClasses"
|
|
6
7
|
/>
|
|
7
8
|
<component
|
|
8
9
|
v-else-if="!useStaticFa && faIconComponent && resolvedDefinition"
|
|
9
10
|
:is="faIconComponent"
|
|
10
11
|
v-bind="iconProps"
|
|
12
|
+
:class="commonClasses"
|
|
11
13
|
/>
|
|
12
14
|
<span
|
|
13
15
|
v-else-if="useStaticFa && resolvedDefinition"
|
|
14
|
-
:class="staticIconClasses"
|
|
16
|
+
:class="[staticIconClasses, commonClasses]"
|
|
15
17
|
aria-hidden="true"
|
|
16
18
|
></span>
|
|
17
19
|
</template>
|
|
18
20
|
|
|
19
21
|
<script setup>
|
|
20
|
-
import { ref, defineAsyncComponent, markRaw, watchEffect, computed } from "vue";
|
|
22
|
+
import { ref, defineAsyncComponent, markRaw, watchEffect, computed, inject } from "vue";
|
|
21
23
|
import { useIcon } from "../../composables/useIcon.js";
|
|
22
|
-
import { getSetting, getIconByType } from "../../settings.js";
|
|
23
24
|
|
|
25
|
+
const uluCore = inject('uluCore');
|
|
24
26
|
const faIconComponent = ref(null);
|
|
25
27
|
const { getIconProps, getClassesFromDefinition } = useIcon();
|
|
26
28
|
|
|
27
29
|
let FaModule;
|
|
28
30
|
|
|
29
31
|
const props = defineProps({
|
|
30
|
-
/**
|
|
31
|
-
* Semantic type of icon to use, will be resolved from settings
|
|
32
|
-
*/
|
|
33
|
-
type: String,
|
|
34
32
|
/**
|
|
35
33
|
* Icon definition can be string (fa classes), or array or object (any prop format FaIcon accepts)
|
|
36
34
|
* - This will override the 'type' prop if both are provided
|
|
37
35
|
*/
|
|
38
|
-
|
|
36
|
+
icon: [String, Array, Object, Boolean],
|
|
37
|
+
/**
|
|
38
|
+
* Whether the icon should use flow inline
|
|
39
|
+
*/
|
|
40
|
+
spaced: Boolean
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
const useStaticFa = computed(() => {
|
|
42
|
-
return getSetting("fontAwesomeStatic");
|
|
44
|
+
return uluCore.getSetting("fontAwesomeStatic");
|
|
43
45
|
});
|
|
44
46
|
|
|
45
47
|
const customIconComponent = computed(() => {
|
|
46
|
-
return getSetting("iconComponent");
|
|
48
|
+
return uluCore.getSetting("iconComponent");
|
|
47
49
|
});
|
|
48
50
|
|
|
49
51
|
const iconPropResolver = computed(() => {
|
|
50
|
-
return getSetting("iconPropResolver");
|
|
52
|
+
return uluCore.getSetting("iconPropResolver");
|
|
51
53
|
});
|
|
52
54
|
|
|
53
55
|
// Resolve the final icon definition, giving precedence to the `definition` prop
|
|
54
56
|
const resolvedDefinition = computed(() => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
if (props.type) {
|
|
57
|
+
const { icon } = props;
|
|
58
|
+
if (typeof icon === 'string' && icon.startsWith('type:')) {
|
|
59
59
|
try {
|
|
60
|
-
|
|
60
|
+
const type = icon.substring(5);
|
|
61
|
+
return uluCore.getIcon(type);
|
|
61
62
|
} catch (e) {
|
|
62
63
|
console.warn(e);
|
|
63
64
|
return null;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
return
|
|
67
|
+
return icon;
|
|
67
68
|
});
|
|
68
69
|
|
|
69
70
|
const customIconProps = computed(() => {
|
|
@@ -81,6 +82,10 @@
|
|
|
81
82
|
return getClassesFromDefinition(resolvedDefinition.value);
|
|
82
83
|
});
|
|
83
84
|
|
|
85
|
+
const commonClasses = computed(() => ({
|
|
86
|
+
'flow-inline': props.spaced
|
|
87
|
+
}));
|
|
88
|
+
|
|
84
89
|
// Watch for changes to prop
|
|
85
90
|
// - Use watchEffect because we are watching reactive object property access (props)
|
|
86
91
|
// - Load FA if needed (so it's not included if it's unneeded)
|
|
@@ -28,60 +28,58 @@
|
|
|
28
28
|
</component>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
|
-
<script>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* Use list-ordered class, and sets element to <ol>
|
|
49
|
-
*/
|
|
50
|
-
ordered: Boolean,
|
|
51
|
-
/**
|
|
52
|
-
* Use list-unordered class
|
|
53
|
-
*/
|
|
54
|
-
unordered: Boolean,
|
|
55
|
-
/**
|
|
56
|
-
* Use list-lines class
|
|
57
|
-
*/
|
|
58
|
-
lines: Boolean,
|
|
59
|
-
/**
|
|
60
|
-
* Use list-compact class
|
|
61
|
-
*/
|
|
62
|
-
compact: Boolean,
|
|
63
|
-
/**
|
|
64
|
-
* If setting up custom ordered list this will ensure the correct element type
|
|
65
|
-
* - Note: 'ordered' prop sets the ordered list class, this does not
|
|
66
|
-
*/
|
|
67
|
-
forceOrdered: Boolean,
|
|
68
|
-
/**
|
|
69
|
-
* Define the start value for <ol>
|
|
70
|
-
*/
|
|
71
|
-
start: String,
|
|
72
|
-
/**
|
|
73
|
-
* Reverse ordered list
|
|
74
|
-
*/
|
|
75
|
-
reversed: Boolean,
|
|
76
|
-
/**
|
|
77
|
-
* Define list style type (ie. disc, decimal, etc)
|
|
78
|
-
*/
|
|
79
|
-
listStyleType: String,
|
|
31
|
+
<script setup>
|
|
32
|
+
import { computed } from "vue";
|
|
33
|
+
|
|
34
|
+
const props = defineProps({
|
|
35
|
+
/**
|
|
36
|
+
* Array of list items, output as is or use slot to template the item
|
|
37
|
+
*/
|
|
38
|
+
items: Array,
|
|
39
|
+
/**
|
|
40
|
+
* Classes object (keys are list and listItem to be applied to <ul> and <li>)
|
|
41
|
+
* - Any valid class binding for each
|
|
42
|
+
*/
|
|
43
|
+
classes: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({})
|
|
80
46
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Use list-ordered class, and sets element to <ol>
|
|
49
|
+
*/
|
|
50
|
+
ordered: Boolean,
|
|
51
|
+
/**
|
|
52
|
+
* Use list-unordered class
|
|
53
|
+
*/
|
|
54
|
+
unordered: Boolean,
|
|
55
|
+
/**
|
|
56
|
+
* Use list-lines class
|
|
57
|
+
*/
|
|
58
|
+
lines: Boolean,
|
|
59
|
+
/**
|
|
60
|
+
* Use list-compact class
|
|
61
|
+
*/
|
|
62
|
+
compact: Boolean,
|
|
63
|
+
/**
|
|
64
|
+
* If setting up custom ordered list this will ensure the correct element type
|
|
65
|
+
* - Note: 'ordered' prop sets the ordered list class, this does not
|
|
66
|
+
*/
|
|
67
|
+
forceOrdered: Boolean,
|
|
68
|
+
/**
|
|
69
|
+
* Define the start value for <ol>
|
|
70
|
+
*/
|
|
71
|
+
start: String,
|
|
72
|
+
/**
|
|
73
|
+
* Reverse ordered list
|
|
74
|
+
*/
|
|
75
|
+
reversed: Boolean,
|
|
76
|
+
/**
|
|
77
|
+
* Define list style type (ie. disc, decimal, etc)
|
|
78
|
+
*/
|
|
79
|
+
listStyleType: String,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const listElement = computed(() => {
|
|
83
|
+
return props.ordered || props.forceOrdered ? "ol" : "ul";
|
|
84
|
+
});
|
|
87
85
|
</script>
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="spoke-spinner"
|
|
4
|
+
:class="{ [`spoke-spinner--${ type }`] : type }"
|
|
5
|
+
>
|
|
3
6
|
<div class="spoke-spinner__spinner">
|
|
4
|
-
<div></div
|
|
7
|
+
<div v-for="n in 12" :key="n"></div>
|
|
5
8
|
</div>
|
|
6
9
|
</div>
|
|
7
10
|
</template>
|
|
8
11
|
|
|
9
|
-
<script>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: String
|
|
17
|
-
},
|
|
18
|
-
computed: {
|
|
19
|
-
modifierClass() {
|
|
20
|
-
const { type } = this;
|
|
21
|
-
return type ? `spoke-spinner--${ type }` : null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
12
|
+
<script setup>
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
/**
|
|
15
|
+
* Type modifier for spinner (ie match scss style name)
|
|
16
|
+
*/
|
|
17
|
+
type: String
|
|
18
|
+
});
|
|
25
19
|
</script>
|