@ulu/frontend-vue 0.1.0-beta.16 → 0.1.0-beta.17
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-BRe-TsJk.js → breakpoints-Cd3pu0Is.js} +1 -1
- package/dist/frontend-vue.js +5 -5
- package/dist/{index-BSMuClr2.js → index-Cdy3vpXx.js} +902 -895
- package/lib/components/elements/UluCard.vue +1 -1
- package/lib/components/systems/facets/_facets.scss +2 -3
- package/lib/components/systems/index.js +5 -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/plugins/core/index.js +2 -1
- package/package.json +5 -4
- package/types/plugins/core/index.d.ts.map +1 -1
- package/lib/components/systems/skeleton/UluSkeletonTextInline.vue +0 -9
|
@@ -5,17 +5,21 @@ export { default as UluFacetsSearch } from './facets/UluFacetsSearch.vue';
|
|
|
5
5
|
export { default as UluFacetsSidebarLayout } from './facets/UluFacetsSidebarLayout.vue';
|
|
6
6
|
export { default as UluFacetsSort } from './facets/UluFacetsSort.vue';
|
|
7
7
|
export { default as UluFacetsList } from './facets/UluFacetsList.vue';
|
|
8
|
+
|
|
8
9
|
export { default as UluScrollAnchors } from './scroll-anchors/UluScrollAnchors.vue';
|
|
9
10
|
export { default as UluScrollAnchorsNav } from './scroll-anchors/UluScrollAnchorsNav.vue';
|
|
10
11
|
export { default as UluScrollAnchorsNavAnimated } from './scroll-anchors/UluScrollAnchorsNavAnimated.vue';
|
|
11
12
|
export { default as UluScrollAnchorsSection } from './scroll-anchors/UluScrollAnchorsSection.vue';
|
|
13
|
+
|
|
12
14
|
export { default as UluShowSkeleton } from './skeleton/UluShowSkeleton.vue';
|
|
13
15
|
export { default as UluSkeletonContent } from './skeleton/UluSkeletonContent.vue';
|
|
14
16
|
export { default as UluSkeletonMedia } from './skeleton/UluSkeletonMedia.vue';
|
|
15
|
-
export { default as
|
|
17
|
+
export { default as UluSkeletonText } from './skeleton/UluSkeletonText.vue';
|
|
18
|
+
|
|
16
19
|
export { default as UluImageSlideShow } from './slider/UluImageSlideShow.vue';
|
|
17
20
|
export { default as UluSlideShow } from './slider/UluSlideShow.vue';
|
|
18
21
|
export { default as UluSlideShowSlide } from './slider/UluSlideShowSlide.vue';
|
|
22
|
+
|
|
19
23
|
export { default as UluTableSticky } from './table-sticky/UluTableSticky.vue';
|
|
20
24
|
export { default as UluTableStickyRows } from './table-sticky/UluTableStickyRows.vue';
|
|
21
25
|
export { default as UluTableStickyTable } from './table-sticky/UluTableStickyTable.vue';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<slot v-if="!when"/>
|
|
3
|
-
<
|
|
3
|
+
<UluSkeletonText v-else inline/>
|
|
4
4
|
</template>
|
|
5
5
|
|
|
6
|
-
<script>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
<script setup>
|
|
7
|
+
import UluSkeletonText from "./UluSkeletonText.vue";
|
|
8
|
+
defineProps({
|
|
9
|
+
/**
|
|
10
|
+
* If true will show whatever is passed to slot, else skeleton text
|
|
11
|
+
*/
|
|
12
|
+
when: Boolean,
|
|
13
|
+
});
|
|
13
14
|
</script>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div>
|
|
3
3
|
<div v-for="(line, index) in linesWithSegments" :key="index">
|
|
4
4
|
<span
|
|
5
5
|
v-for="segment in line"
|
|
6
6
|
:key="segment"
|
|
7
|
-
class="
|
|
8
|
-
:class="{ '
|
|
7
|
+
class="skeleton skeleton--text skeleton--inline"
|
|
8
|
+
:class="{ 'skeleton--background-alt' : segment.alt }"
|
|
9
9
|
:style="{ width: `${ segment.width }%` }"
|
|
10
10
|
>
|
|
11
11
|
</span>
|
|
@@ -13,48 +13,44 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
-
<script>
|
|
16
|
+
<script setup>
|
|
17
|
+
import { computed } from "vue";
|
|
17
18
|
import { randomInt } from "@ulu/utils/random.js";
|
|
18
19
|
import { arrayCreate } from "@ulu/utils/array.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
methods: {
|
|
28
|
-
randomInt
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
/**
|
|
23
|
+
* Amount of lines to generate
|
|
24
|
+
*/
|
|
25
|
+
lines: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 6
|
|
29
28
|
},
|
|
30
|
-
|
|
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
|
-
return segments.map(width => ({ width, alt: Math.random() < 0.5 }));
|
|
56
|
-
});
|
|
57
|
-
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates the segments (like words) for the given line count
|
|
33
|
+
* - Uses random number of segments and makes sure to fill the line between 70% - 100%
|
|
34
|
+
*/
|
|
35
|
+
const linesWithSegments = computed(() => arrayCreate(props.lines, () => {
|
|
36
|
+
const minWidth = 15;
|
|
37
|
+
const total = randomInt(70, 100);
|
|
38
|
+
let widthCurrent = 0;
|
|
39
|
+
const newWidth = () => {
|
|
40
|
+
const remaining = total - widthCurrent;
|
|
41
|
+
const width = randomInt(minWidth, remaining);
|
|
42
|
+
widthCurrent += width;
|
|
43
|
+
return width;
|
|
44
|
+
};
|
|
45
|
+
const segments = [];
|
|
46
|
+
while (widthCurrent < total - minWidth) {
|
|
47
|
+
segments.push(newWidth());
|
|
48
|
+
}
|
|
49
|
+
const getActualTotal = () => segments.reduce((acc, a) => acc + a, 0);
|
|
50
|
+
while (getActualTotal() >= total) {
|
|
51
|
+
let removed = segments.pop();
|
|
52
|
+
if (!removed) break;
|
|
58
53
|
}
|
|
59
|
-
|
|
54
|
+
return segments.map(width => ({ width, alt: Math.random() < 0.5 }));
|
|
55
|
+
}));
|
|
60
56
|
</script>
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<
|
|
2
|
+
<div class="skeleton skeleton-block--media">
|
|
3
|
+
<UluIcon icon="type:image"/>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<script>
|
|
8
|
-
|
|
9
|
-
name: "SkeletonMedia",
|
|
10
|
-
};
|
|
7
|
+
<script setup>
|
|
8
|
+
import UluIcon from "../../elements/UluIcon.vue";
|
|
11
9
|
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
class="skeleton skeleton--text"
|
|
4
|
+
:class="{
|
|
5
|
+
'skeleton--inline' : inline,
|
|
6
|
+
'skeleton--background-alt' : alt,
|
|
7
|
+
[`skeleton--width-${ width }`] : width
|
|
8
|
+
}"
|
|
9
|
+
></span>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
defineProps({
|
|
14
|
+
/**
|
|
15
|
+
* Inline modifier
|
|
16
|
+
*/
|
|
17
|
+
inline: Boolean,
|
|
18
|
+
/**
|
|
19
|
+
* Use alternate background color
|
|
20
|
+
*/
|
|
21
|
+
alt: Boolean,
|
|
22
|
+
/**
|
|
23
|
+
* Optional size (width) - should correspond with width setup in scss component
|
|
24
|
+
*/
|
|
25
|
+
width: String
|
|
26
|
+
});
|
|
27
|
+
</script>
|
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.17",
|
|
4
4
|
"description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"docs:build": "storybook build -o docs",
|
|
36
36
|
"build": "vite build",
|
|
37
37
|
"types": "npx tsc",
|
|
38
|
-
"deploy": "npm run types && npm run build && npm run docs:build"
|
|
38
|
+
"deploy": "npm run types && npm run build && npm run docs:build",
|
|
39
|
+
"update-contexts": "rm -rf .contexts && mkdir -p .contexts/frontend && cp -R node_modules/@ulu/frontend/scss node_modules/@ulu/frontend/js .contexts/frontend/"
|
|
39
40
|
},
|
|
40
41
|
"keywords": [
|
|
41
42
|
"vue",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"homepage": "https://github.com/Jscherbe/frontend-vue#readme",
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"@headlessui/vue": "^1.7.23",
|
|
59
|
-
"@ulu/frontend": "^0.1.0-beta.
|
|
60
|
+
"@ulu/frontend": "^0.1.0-beta.100",
|
|
60
61
|
"vue": "^3.5.17",
|
|
61
62
|
"vue-router": "^4.5.1"
|
|
62
63
|
},
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"@storybook/addon-links": "^9.1.1",
|
|
79
80
|
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
80
81
|
"@storybook/vue3-vite": "^9.1.1",
|
|
81
|
-
"@ulu/frontend": "^0.1.0-beta.
|
|
82
|
+
"@ulu/frontend": "^0.1.0-beta.100",
|
|
82
83
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
83
84
|
"ollama": "^0.5.16",
|
|
84
85
|
"react": "^19.1.1",
|
|
@@ -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":"AA8BA,mEAyDC;AA3DD,gCAA0D"}
|