@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
|
@@ -3,51 +3,51 @@
|
|
|
3
3
|
class="tag"
|
|
4
4
|
:class="[
|
|
5
5
|
{
|
|
6
|
-
'tag--
|
|
7
|
-
|
|
6
|
+
'tag--counter' : counter,
|
|
7
|
+
[`tag--${ size }`] : size,
|
|
8
8
|
[`tag--${ type }`] : type
|
|
9
9
|
},
|
|
10
10
|
resolvedModifiers
|
|
11
11
|
]"
|
|
12
12
|
>
|
|
13
|
-
<UluIcon v-if="icon" :
|
|
13
|
+
<UluIcon v-if="icon" :icon="icon" spaced />
|
|
14
14
|
<slot>
|
|
15
|
-
{{ text }}
|
|
15
|
+
<span>{{ text }}</span>
|
|
16
16
|
</slot>
|
|
17
17
|
</span>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
|
-
<script>
|
|
20
|
+
<script setup>
|
|
21
21
|
import UluIcon from "./UluIcon.vue";
|
|
22
22
|
import { useModifiers } from "../../composables/useModifiers.js";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
/**
|
|
26
|
+
* Type (corresponds with styles setup for tag in scss module)
|
|
27
|
+
*/
|
|
28
|
+
type: [String],
|
|
29
|
+
/**
|
|
30
|
+
* Size (corresponds with sizes setup for tag in scss module)
|
|
31
|
+
*/
|
|
32
|
+
size: String,
|
|
33
|
+
/**
|
|
34
|
+
* Use counter style (for numbers, etc)
|
|
35
|
+
*/
|
|
36
|
+
counter: Boolean,
|
|
37
|
+
/**
|
|
38
|
+
* Text for tag, or use slot
|
|
39
|
+
*/
|
|
40
|
+
text: [String, Number],
|
|
41
|
+
/**
|
|
42
|
+
* Icon prop, if used will set the icon for the button, will use UluIcon (which uses font-awesome icons conditionally)
|
|
43
|
+
* - If using custom icons use slot instead
|
|
44
|
+
*/
|
|
45
|
+
icon: [String, Array],
|
|
46
|
+
/**
|
|
47
|
+
* Modifiers for tag class
|
|
48
|
+
*/
|
|
49
|
+
modifiers: [String, Array]
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const { resolvedModifiers } = useModifiers({ props, baseClass: "tag" });
|
|
53
53
|
</script>
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
<div class="menu-stack form-theme">
|
|
3
|
+
<ul class="menu-stack__list">
|
|
4
|
+
<li
|
|
5
|
+
class="menu-stack__item"
|
|
6
|
+
v-for="(option, index) in options"
|
|
7
|
+
:key="index"
|
|
8
|
+
>
|
|
9
|
+
<div class="menu-stack__selectable">
|
|
10
|
+
<input
|
|
11
|
+
type="checkbox"
|
|
12
|
+
:id="getId(index)"
|
|
13
|
+
v-model="option.checked"
|
|
14
|
+
>
|
|
15
|
+
<label :for="getId(index)">
|
|
16
|
+
<slot>
|
|
17
|
+
{{ option?.title || option?.text }}
|
|
18
|
+
</slot>
|
|
19
|
+
</label>
|
|
20
|
+
</div>
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
22
24
|
</template>
|
|
23
25
|
|
|
24
|
-
<script>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
26
|
+
<script setup>
|
|
27
|
+
defineProps({
|
|
28
|
+
/**
|
|
29
|
+
* Checkbox items in [{ title|text, checked }, ...]
|
|
30
|
+
*/
|
|
31
|
+
options: Array
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const getId = (index) => {
|
|
35
|
+
return `checkbox-menu-opt-${ index }`;
|
|
35
36
|
};
|
|
36
37
|
</script>
|
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a class="layout-flex-baseline" :href="fileUrl" :download="file.name">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<slot :fileName="file.name" :fileSize="fileSize">
|
|
4
|
+
<UluIcon class="ui-icon" :icon="icon"/>
|
|
5
|
+
<span class="margin-left-small-x">
|
|
6
|
+
{{ file.name }}
|
|
7
|
+
<UluTag v-if="!noFileSize" :text="fileSize" small outline />
|
|
8
|
+
</span>
|
|
9
|
+
</slot>
|
|
8
10
|
</a>
|
|
9
11
|
</template>
|
|
10
12
|
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
<script setup>
|
|
14
|
+
import { computed } from "vue";
|
|
15
|
+
import UluIcon from "../elements/UluIcon.vue";
|
|
16
|
+
import UluTag from "../elements/UluTag.vue";
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
file: {
|
|
20
|
+
required: true,
|
|
21
|
+
type: Object,
|
|
19
22
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
fileSize() {
|
|
25
|
-
const { size } = this.file;
|
|
26
|
-
const Mbs = size / 1000000;
|
|
27
|
-
const Kbs = size / 1000;
|
|
28
|
-
const format = n => parseFloat(n.toFixed(2));
|
|
29
|
-
// Either display Mbs or Kbs if less than 1 Mb
|
|
30
|
-
/* eslint-disable */
|
|
31
|
-
return Mbs > 1 ?
|
|
32
|
-
`${ format(Mbs) }Mb` : Kbs > 1 ?
|
|
33
|
-
`${ format(Kbs) }Kb` :
|
|
34
|
-
`${ format(size) }B`;
|
|
35
|
-
/* eslint-enable */
|
|
36
|
-
}
|
|
23
|
+
icon: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "type:file"
|
|
37
26
|
},
|
|
38
|
-
|
|
27
|
+
noFileSize: Boolean
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const fileUrl = computed(() => {
|
|
31
|
+
if (typeof window === 'undefined') return '';
|
|
32
|
+
return window.URL.createObjectURL(props.file);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const fileSize = computed(() => {
|
|
36
|
+
const { size } = props.file;
|
|
37
|
+
const Mbs = size / 1000000;
|
|
38
|
+
const Kbs = size / 1000;
|
|
39
|
+
const format = n => parseFloat(n.toFixed(2));
|
|
40
|
+
// Either display Mbs or Kbs if less than 1 Mb
|
|
41
|
+
/* eslint-disable */
|
|
42
|
+
return Mbs > 1 ?
|
|
43
|
+
`${ format(Mbs) }Mb` : Kbs > 1 ?
|
|
44
|
+
`${ format(Kbs) }Kb` :
|
|
45
|
+
`${ format(size) }B`;
|
|
46
|
+
/* eslint-enable */
|
|
47
|
+
});
|
|
39
48
|
</script>
|
|
@@ -18,30 +18,28 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
|
-
<script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
noClasses: Boolean,
|
|
32
|
-
multiple: Boolean,
|
|
33
|
-
inputAttrs: Object
|
|
34
|
-
},
|
|
35
|
-
emits: ["filesChange"],
|
|
36
|
-
data() {
|
|
37
|
-
return {
|
|
38
|
-
id: `file-input-id-${ ++count }`
|
|
39
|
-
};
|
|
21
|
+
<script setup>
|
|
22
|
+
const getNextId = (() => {
|
|
23
|
+
let count = 0;
|
|
24
|
+
return () => `file-input-id-${++count}`;
|
|
25
|
+
})();
|
|
26
|
+
|
|
27
|
+
defineProps({
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "Select File"
|
|
40
31
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
labelHidden: Boolean,
|
|
33
|
+
noClasses: Boolean,
|
|
34
|
+
multiple: Boolean,
|
|
35
|
+
inputAttrs: Object
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits(["file-change"]);
|
|
39
|
+
|
|
40
|
+
const id = getNextId();
|
|
41
|
+
|
|
42
|
+
const onChangeFile = (event) => {
|
|
43
|
+
emit("file-change", event.target.files);
|
|
46
44
|
};
|
|
47
45
|
</script>
|
|
@@ -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>
|
package/lib/components/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { default as UluAlert } from './elements/UluAlert.vue';
|
|
|
17
17
|
export { default as UluBadge } from './elements/UluBadge.vue';
|
|
18
18
|
export { default as UluBadgeStack } from './elements/UluBadgeStack.vue';
|
|
19
19
|
export { default as UluButton } from './elements/UluButton.vue';
|
|
20
|
+
export { default as UluButtonVerbose } from './elements/UluButtonVerbose.vue';
|
|
20
21
|
export { default as UluCallout } from './elements/UluCallout.vue';
|
|
21
22
|
export { default as UluCard } from './elements/UluCard.vue';
|
|
22
23
|
export { default as UluDefinitionList } from './elements/UluDefinitionList.vue';
|
|
@@ -28,7 +29,6 @@ export { default as UluSpokeSpinner } from './elements/UluSpokeSpinner.vue';
|
|
|
28
29
|
export { default as UluTag } from './elements/UluTag.vue';
|
|
29
30
|
export { default as UluCheckboxMenu } from './forms/UluCheckboxMenu.vue';
|
|
30
31
|
export { default as UluFileDisplay } from './forms/UluFileDisplay.vue';
|
|
31
|
-
export { default as UluFormDropzone } from './forms/UluFormDropzone.vue';
|
|
32
32
|
export { default as UluFormFile } from './forms/UluFormFile.vue';
|
|
33
33
|
export { default as UluFormMessage } from './forms/UluFormMessage.vue';
|
|
34
34
|
export { default as UluFormSelect } from './forms/UluFormSelect.vue';
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
<slot v-else name="mobile" />
|
|
4
4
|
</template>
|
|
5
5
|
|
|
6
|
-
<script>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
inject: ["uluIsMobile"],
|
|
10
|
-
};
|
|
6
|
+
<script setup>
|
|
7
|
+
import { useRequiredInject } from '../../composables/useRequiredInject.js';
|
|
8
|
+
const uluIsMobile = useRequiredInject('uluIsMobile');
|
|
11
9
|
</script>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="rail rail--title-rail"
|
|
4
|
+
:class="{
|
|
5
|
+
'rail--rule' : rule
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
3
8
|
<div class="rail__item rail__item--title" :class="classes.itemTitle">
|
|
4
9
|
<component
|
|
5
10
|
class="layout-flex type-max-width-small no-margin"
|
|
@@ -8,10 +13,9 @@
|
|
|
8
13
|
:style="{ alignItems: iconAlign }"
|
|
9
14
|
>
|
|
10
15
|
<UluIcon
|
|
11
|
-
v-if="icon
|
|
16
|
+
v-if="icon"
|
|
12
17
|
:class="classes.icon"
|
|
13
|
-
:
|
|
14
|
-
:definition="icon"
|
|
18
|
+
:icon="icon"
|
|
15
19
|
/>
|
|
16
20
|
<slot>
|
|
17
21
|
{{ title }}
|
|
@@ -38,7 +42,6 @@
|
|
|
38
42
|
type: String,
|
|
39
43
|
default: "baseline"
|
|
40
44
|
},
|
|
41
|
-
iconType: String,
|
|
42
45
|
classes: {
|
|
43
46
|
type: Object,
|
|
44
47
|
default: () => ({
|
|
@@ -51,6 +54,7 @@
|
|
|
51
54
|
type: String,
|
|
52
55
|
default: "h2"
|
|
53
56
|
},
|
|
57
|
+
rule: Boolean
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
</script>
|
|
@@ -2,85 +2,79 @@
|
|
|
2
2
|
<slot v-if="shouldShow" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
data() {
|
|
15
|
-
return {
|
|
16
|
-
conditions: {},
|
|
17
|
-
handlers: [],
|
|
18
|
-
handlersSetup: false,
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
computed: {
|
|
22
|
-
shouldShow() {
|
|
23
|
-
if (!this.handlersSetup) return false;
|
|
24
|
-
const props = ['max', 'min', 'only'].filter(p => this[p]);
|
|
25
|
-
if (props.length === 0) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return Object.values(this.conditions).every(c => c);
|
|
29
|
-
},
|
|
30
|
-
propsIdentifier() {
|
|
31
|
-
return `${this.max || ''}-${this.min || ''}-${this.only || ''}`;
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
watch: {
|
|
35
|
-
uluBreakpointManager: {
|
|
36
|
-
handler(manager) {
|
|
37
|
-
if (manager && !this.handlersSetup) {
|
|
38
|
-
this.setupHandlers(manager);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
immediate: true
|
|
42
|
-
},
|
|
43
|
-
propsIdentifier() {
|
|
44
|
-
if (this.uluBreakpointManager && this.handlersSetup) {
|
|
45
|
-
this.tearDownHandlers();
|
|
46
|
-
this.setupHandlers(this.uluBreakpointManager);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
setupHandlers(manager) {
|
|
52
|
-
const setupCondition = (direction) => {
|
|
53
|
-
const breakpointName = this[direction];
|
|
54
|
-
if (breakpointName) {
|
|
55
|
-
this.conditions[direction] = false;
|
|
56
|
-
const handler = {
|
|
57
|
-
on: () => { this.conditions[direction] = true; },
|
|
58
|
-
off: () => { this.conditions[direction] = false; },
|
|
59
|
-
};
|
|
60
|
-
manager.at(breakpointName)[direction](handler);
|
|
61
|
-
this.handlers.push({ name: breakpointName, direction, handler });
|
|
62
|
-
}
|
|
63
|
-
};
|
|
5
|
+
<script setup>
|
|
6
|
+
import { ref, computed, watch, onBeforeUnmount } from 'vue';
|
|
7
|
+
import { useRequiredInject } from '../../composables/useRequiredInject.js';
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
max: String,
|
|
11
|
+
min: String,
|
|
12
|
+
only: String,
|
|
13
|
+
});
|
|
64
14
|
|
|
65
|
-
|
|
66
|
-
setupCondition('min');
|
|
67
|
-
setupCondition('only');
|
|
15
|
+
const uluBreakpointManager = useRequiredInject('uluBreakpointManager');
|
|
68
16
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
17
|
+
const conditions = ref({});
|
|
18
|
+
const handlers = ref([]);
|
|
19
|
+
const handlersSetup = ref(false);
|
|
20
|
+
|
|
21
|
+
const shouldShow = computed(() => {
|
|
22
|
+
if (!handlersSetup.value) return false;
|
|
23
|
+
const activeProps = ['max', 'min', 'only'].filter(p => props[p]);
|
|
24
|
+
if (activeProps.length === 0) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return Object.values(conditions.value).every(c => c);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const setupHandlers = (manager) => {
|
|
31
|
+
const setupCondition = (direction) => {
|
|
32
|
+
const breakpointName = props[direction];
|
|
33
|
+
if (breakpointName) {
|
|
34
|
+
conditions.value[direction] = false;
|
|
35
|
+
const handler = {
|
|
36
|
+
on: () => { conditions.value[direction] = true; },
|
|
37
|
+
off: () => { conditions.value[direction] = false; },
|
|
38
|
+
};
|
|
39
|
+
manager.at(breakpointName)[direction](handler);
|
|
40
|
+
handlers.value.push({ name: breakpointName, direction, handler });
|
|
80
41
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
setupCondition('max');
|
|
45
|
+
setupCondition('min');
|
|
46
|
+
setupCondition('only');
|
|
47
|
+
|
|
48
|
+
handlersSetup.value = true;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const tearDownHandlers = () => {
|
|
52
|
+
if (uluBreakpointManager) {
|
|
53
|
+
handlers.value.forEach(({ name, direction, handler }) => {
|
|
54
|
+
uluBreakpointManager.at(name).remove(handler, direction);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
handlers.value = [];
|
|
58
|
+
conditions.value = {};
|
|
59
|
+
handlersSetup.value = false;
|
|
85
60
|
};
|
|
61
|
+
|
|
62
|
+
watch(uluBreakpointManager, (manager) => {
|
|
63
|
+
if (manager && !handlersSetup.value) {
|
|
64
|
+
setupHandlers(manager);
|
|
65
|
+
}
|
|
66
|
+
}, { immediate: true });
|
|
67
|
+
|
|
68
|
+
// Watch all the props and update if they change
|
|
69
|
+
// - Using array syntax to avoid "deep" flag
|
|
70
|
+
watch([() => props.max, () => props.min, () => props.only], () => {
|
|
71
|
+
if (uluBreakpointManager && handlersSetup.value) {
|
|
72
|
+
tearDownHandlers();
|
|
73
|
+
setupHandlers(uluBreakpointManager);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
onBeforeUnmount(() => {
|
|
78
|
+
tearDownHandlers();
|
|
79
|
+
});
|
|
86
80
|
</script>
|