@energie360/ui-library 0.1.44 → 0.1.46
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/components/accordion-item/u-accordion-item.vue +2 -1
- package/components/card-amount-illustrated/u-card-amount-illustrated.vue +4 -3
- package/components/card-footer/u-card-footer.vue +15 -7
- package/components/card-group/u-card-group.vue +3 -3
- package/components/card-section/card-section.scss +5 -0
- package/components/card-table/u-card-table.vue +1 -1
- package/components/collapsible/u-collapsible.vue +7 -2
- package/components/download-list-item/u-download-list-item.vue +1 -1
- package/components/file-upload/u-file-upload.vue +3 -3
- package/components/hint/hint.scss +5 -0
- package/components/hint/u-hint.vue +1 -1
- package/components/icon-text-block/icon-text-block.scss +4 -3
- package/components/index.ts +78 -0
- package/components/inline-edit/u-inline-edit.vue +1 -1
- package/components/navigation-panel-tile/navigation-panel-tile.scss +7 -0
- package/components/slider/u-slider.vue +4 -2
- package/components/slider-progress-animation/u-slider-progress-animation.vue +14 -10
- package/components/table/table-cell.mixins.scss +2 -2
- package/components/table/u-table-cell.vue +1 -3
- package/components/welcome/u-welcome.vue +1 -1
- package/dist/layout/form-grid.css +43 -145
- package/dist/layout/form-grid.css.map +1 -1
- package/dist/layout/grid.css +780 -2951
- package/dist/layout/grid.css.map +1 -1
- package/elements/icon/u-icon.vue +1 -1
- package/elements/index.ts +24 -0
- package/elements/radio-group/radio-group-composables.ts +4 -1
- package/elements/textarea/u-textarea.vue +4 -4
- package/layout/grid/grid.mixin.scss +69 -50
- package/main.ts +2 -0
- package/modules/content-title/content-title.scss +6 -0
- package/modules/content-title/u-content-title.vue +1 -1
- package/modules/navigation-toolbar-side/u-navigation-toolbar-side.vue +1 -1
- package/modules/navigation-toolbar-top/u-navigation-toolbar-top.vue +12 -4
- package/package.json +11 -3
- package/tsconfig.build.json +14 -0
- package/tsconfig.json +4 -1
- package/vite.config.js +32 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import UCollapsible from '../collapsible/u-collapsible.vue'
|
|
3
|
+
import { collapsibleHeadingLevel } from '../collapsible/u-collapsible.vue'
|
|
3
4
|
import UIcon from '../../elements/icon/u-icon.vue'
|
|
4
5
|
import URichtext from '../richtext/u-richtext.vue'
|
|
5
6
|
import { useTemplateRef } from 'vue'
|
|
@@ -7,7 +8,7 @@ import { useTemplateRef } from 'vue'
|
|
|
7
8
|
interface Props {
|
|
8
9
|
header?: string
|
|
9
10
|
panel?: string
|
|
10
|
-
level?:
|
|
11
|
+
level?: collapsibleHeadingLevel
|
|
11
12
|
inverted?: boolean
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import UProgressBar from '../progress-bar/u-progress-bar.vue'
|
|
3
|
-
import { useTemplateRef, inject, watch, ref, onMounted } from 'vue'
|
|
3
|
+
import { useTemplateRef, inject, watch, ref, onMounted, TemplateRef } from 'vue'
|
|
4
4
|
import { Image } from '../../elements/types'
|
|
5
5
|
import { DotLottieVue, setWasmUrl } from '@lottiefiles/dotlottie-vue'
|
|
6
|
+
import { DotLottieVueInstance } from '@lottiefiles/dotlottie-vue'
|
|
6
7
|
import wasmUrl from '@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm?url'
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
@@ -16,7 +17,7 @@ setWasmUrl(wasmUrl)
|
|
|
16
17
|
|
|
17
18
|
const { lottieSrc, title = '', amount = -1 } = defineProps<Props>()
|
|
18
19
|
defineEmits(['amount'])
|
|
19
|
-
const { isHovering: cardIsHovering } = inject('card', {})
|
|
20
|
+
const { isHovering: cardIsHovering } = inject('card', { isHovering: null })
|
|
20
21
|
|
|
21
22
|
const lottiePlayerRef = useTemplateRef('player')
|
|
22
23
|
let lottiePlayer = null
|
|
@@ -45,7 +46,7 @@ const onMouseleave = () => {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
onMounted(() => {
|
|
48
|
-
lottiePlayer = lottiePlayerRef.value.getDotLottieInstance()
|
|
49
|
+
lottiePlayer = (lottiePlayerRef.value as DotLottieVueInstance).getDotLottieInstance()
|
|
49
50
|
|
|
50
51
|
lottiePlayer.addEventListener('load', () => {
|
|
51
52
|
lottieReady.value = true
|
|
@@ -24,22 +24,22 @@ const { cta = undefined } = defineProps<Props>()
|
|
|
24
24
|
|
|
25
25
|
const emits = defineEmits(['change'])
|
|
26
26
|
|
|
27
|
-
const { toggleActiveCard } = inject('card')
|
|
28
|
-
const { currentValue } = inject('card-group', {})
|
|
27
|
+
const { toggleActiveCard } = inject('card', { toggleActiveCard: null })
|
|
28
|
+
const { currentValue } = inject('card-group', { currentValue: null })
|
|
29
29
|
|
|
30
30
|
const onChange = () => {
|
|
31
31
|
toggleActiveCard(true)
|
|
32
|
-
emits('change', cta.value)
|
|
32
|
+
emits('change', (cta as Radio).value)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (currentValue) {
|
|
36
36
|
watch(currentValue, (newV) => {
|
|
37
|
-
toggleActiveCard(newV === cta.value && !cta.disabled)
|
|
37
|
+
toggleActiveCard(newV === (cta as Radio).value && !(cta as Radio).disabled)
|
|
38
38
|
})
|
|
39
39
|
|
|
40
40
|
onMounted(() => {
|
|
41
41
|
if (currentValue?.value) {
|
|
42
|
-
toggleActiveCard(currentValue.value === cta.value && !cta.disabled)
|
|
42
|
+
toggleActiveCard(currentValue.value === (cta as Radio).value && !(cta as Radio).disabled)
|
|
43
43
|
}
|
|
44
44
|
})
|
|
45
45
|
}
|
|
@@ -48,9 +48,17 @@ if (currentValue) {
|
|
|
48
48
|
<template>
|
|
49
49
|
<div class="card-footer">
|
|
50
50
|
<slot>
|
|
51
|
-
<UButton v-if="cta.href" variant="outlined" v-bind="cta" />
|
|
51
|
+
<UButton v-if="(cta as Link).href" variant="outlined" v-bind="cta as Link" />
|
|
52
52
|
|
|
53
|
-
<USelectChip
|
|
53
|
+
<USelectChip
|
|
54
|
+
v-else
|
|
55
|
+
provide-key="card-group"
|
|
56
|
+
:label="cta.label"
|
|
57
|
+
:name="(cta as Radio).name"
|
|
58
|
+
:value="(cta as Radio).value"
|
|
59
|
+
:disabled="(cta as Radio).disabled"
|
|
60
|
+
@change="onChange"
|
|
61
|
+
/>
|
|
54
62
|
</slot>
|
|
55
63
|
</div>
|
|
56
64
|
</template>
|
|
@@ -21,7 +21,7 @@ const onResize = debounceRaf(() => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Reset heights
|
|
24
|
-
headers.forEach((header) => {
|
|
24
|
+
headers.forEach((header: HTMLElement) => {
|
|
25
25
|
header.style.height = ''
|
|
26
26
|
})
|
|
27
27
|
|
|
@@ -31,12 +31,12 @@ const onResize = debounceRaf(() => {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Get max height
|
|
34
|
-
const maxHeight = headers.reduce((acc, val) => {
|
|
34
|
+
const maxHeight = headers.reduce((acc, val: HTMLElement) => {
|
|
35
35
|
return Math.max(acc, val.offsetHeight)
|
|
36
36
|
}, 0)
|
|
37
37
|
|
|
38
38
|
// Adjust heights
|
|
39
|
-
headers.forEach((header) => {
|
|
39
|
+
headers.forEach((header: HTMLElement) => {
|
|
40
40
|
header.style.height = `${maxHeight}px`
|
|
41
41
|
})
|
|
42
42
|
})
|
|
@@ -25,7 +25,7 @@ const getCellDiscount = (cell: Cell): string => (cell.discount ? cell.text : '')
|
|
|
25
25
|
|
|
26
26
|
<template>
|
|
27
27
|
<div class="card-table-wrapper">
|
|
28
|
-
<div class="card-table-heading">
|
|
28
|
+
<div v-if="title || secondaryTitle" class="card-table-heading">
|
|
29
29
|
<div v-if="title" class="card-table-heading__title">
|
|
30
30
|
{{ title }}
|
|
31
31
|
</div>
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { useId, computed, ref, inject, watch } from 'vue'
|
|
3
3
|
import TransitionHeight from '../../helpers/transition-height.vue'
|
|
4
4
|
|
|
5
|
+
export type collapsibleHeadingLevel = 2 | 3 | 4 | 5 | 6 | 'aaaa'
|
|
6
|
+
|
|
5
7
|
interface Props {
|
|
6
8
|
header?: string
|
|
7
9
|
panel?: string
|
|
8
|
-
level?:
|
|
10
|
+
level?: collapsibleHeadingLevel
|
|
9
11
|
expanded?: boolean
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -20,7 +22,10 @@ const headerId = `collapsible-header-${cId}`
|
|
|
20
22
|
const panelId = `collapsible-panel-${cId}`
|
|
21
23
|
|
|
22
24
|
// This will only be available if there's a parent <UCollapsibelGroup>
|
|
23
|
-
const { activeItem, updateActiveItem } = inject('activeItem', {
|
|
25
|
+
const { activeItem, updateActiveItem } = inject('activeItem', {
|
|
26
|
+
activeItem: null,
|
|
27
|
+
updateActiveItem: null,
|
|
28
|
+
})
|
|
24
29
|
|
|
25
30
|
const onToggle = () => {
|
|
26
31
|
panelHidden.value = !panelHidden.value
|
|
@@ -69,7 +69,7 @@ const handleFiles = (files: FileList) => {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
const acceptedFiles = []
|
|
72
|
-
for (const file of files) {
|
|
72
|
+
for (const file of Array.from(files)) {
|
|
73
73
|
if (
|
|
74
74
|
accept.length === 0 ||
|
|
75
75
|
(intersect(mimeTypes[file.type] || [], accept).length && file.size <= maxFileSize)
|
|
@@ -89,7 +89,7 @@ const handleFiles = (files: FileList) => {
|
|
|
89
89
|
currentFiles.value.push(...acceptedFiles)
|
|
90
90
|
maxFileCountError.value = false
|
|
91
91
|
|
|
92
|
-
input.value.files = arrayToFileList(currentFiles.value)
|
|
92
|
+
input.value.files = arrayToFileList(currentFiles.value as [])
|
|
93
93
|
|
|
94
94
|
checkMaxFiles()
|
|
95
95
|
}
|
|
@@ -137,7 +137,7 @@ const onRemoveFile = (filename: string, lastModified: number) => {
|
|
|
137
137
|
(file) => file.name !== filename || file.lastModified !== lastModified,
|
|
138
138
|
)
|
|
139
139
|
|
|
140
|
-
input.value.files = arrayToFileList(currentFiles.value)
|
|
140
|
+
input.value.files = arrayToFileList(currentFiles.value as [])
|
|
141
141
|
|
|
142
142
|
checkMaxFiles()
|
|
143
143
|
}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
// override some richtext styles.
|
|
23
23
|
.richtext {
|
|
24
|
+
// URichtext normally needs html-text, meaning the text is at least in a <p>-tag.
|
|
25
|
+
// Unfortunately hint will receive also plain text.
|
|
26
|
+
// That's why we haven the set font-size here too.
|
|
27
|
+
@include a.type(200);
|
|
28
|
+
|
|
24
29
|
a {
|
|
25
30
|
font-size: 100px;
|
|
26
31
|
color: inherit;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '../../base/abstracts
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
2
|
|
|
3
3
|
.icon-text-block {
|
|
4
4
|
display: flex;
|
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.illustration {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
object-fit: contain;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.content {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export { default as UAccordionItem } from './accordion-item/u-accordion-item.vue'
|
|
2
|
+
|
|
3
|
+
// Cards
|
|
4
|
+
export { default as UCard } from './card/u-card.vue'
|
|
5
|
+
export { default as UCardFooter } from './card-footer/u-card-footer.vue'
|
|
6
|
+
export { default as UCardGroup } from './card-group/u-card-group.vue'
|
|
7
|
+
export { default as UCardHeader } from './card-header/u-card-header.vue'
|
|
8
|
+
export { default as UCardHint } from './card-hint/u-card-hint.vue'
|
|
9
|
+
export { default as UCardPrice } from './card-price/u-card-price.vue'
|
|
10
|
+
export { default as UCardSection } from './card-section/u-card-section.vue'
|
|
11
|
+
export { default as UCardTable } from './card-table/u-card-table.vue'
|
|
12
|
+
export { default as UCardToggleSwitches } from './card-toggle-switches/u-card-toggle-switches.vue'
|
|
13
|
+
export { default as UCardCtaHeader } from './card-cta-header/u-card-cta-header.vue'
|
|
14
|
+
export { default as UCardCtaBar } from './card-cta-bar/u-card-cta-bar.vue'
|
|
15
|
+
export { default as UCardContact } from './card-contact/u-card-contact.vue'
|
|
16
|
+
export { default as UCardPriceList } from './card-price-list/u-card-price-list.vue'
|
|
17
|
+
export { default as UCardAmountIllustrated } from './card-amount-illustrated/u-card-amount-illustrated.vue'
|
|
18
|
+
export { default as UCardAmount } from './card-amount/u-card-amount.vue'
|
|
19
|
+
|
|
20
|
+
// Collapsible
|
|
21
|
+
export { default as UCollapsible } from './collapsible/u-collapsible.vue'
|
|
22
|
+
export { default as UCollapsibleGroup } from './collapsible-group/u-collapsible-group.vue'
|
|
23
|
+
|
|
24
|
+
export { default as UIconTextBlock } from './icon-text-block/u-icon-text-block.vue'
|
|
25
|
+
export { default as UIconTextBlockGroup } from './icon-text-block-group/u-icon-text-block-group.vue'
|
|
26
|
+
export { default as UInlineEdit } from './inline-edit/u-inline-edit.vue'
|
|
27
|
+
export { default as ULanguageNav } from './language-nav/u-language-nav.vue'
|
|
28
|
+
export { default as UPanel } from './panel/u-panel.vue'
|
|
29
|
+
export { default as UProgressBar } from './progress-bar/u-progress-bar.vue'
|
|
30
|
+
export { default as URichtext } from './richtext/u-richtext.vue'
|
|
31
|
+
|
|
32
|
+
// Table
|
|
33
|
+
export { default as UCellCtas } from './table/u-cell-ctas.vue'
|
|
34
|
+
export { default as UCellIconGroup } from './table/u-cell-icon-group.vue'
|
|
35
|
+
export { default as UCellIconText } from './table/u-cell-icon-text.vue'
|
|
36
|
+
export { default as UCellProgressBar } from './table/u-cell-progress-bar.vue'
|
|
37
|
+
export { default as UTableCell } from './table/u-table-cell.vue'
|
|
38
|
+
export { default as UTableHeader } from './table/u-table-header.vue'
|
|
39
|
+
export { default as UTableHeading } from './table/u-table-heading.vue'
|
|
40
|
+
export { default as UTableRow } from './table/u-table-row.vue'
|
|
41
|
+
export { default as UTable } from './table/u-table.vue'
|
|
42
|
+
|
|
43
|
+
export { default as UTabs } from './tabs/u-tabs.vue'
|
|
44
|
+
export { default as UTextBlock } from './text-block/u-text-block.vue'
|
|
45
|
+
export { default as UTooltip } from './tooltip/u-tooltip.vue'
|
|
46
|
+
export { default as UNavigationToolbarLink } from './navigation-toolbar-link/u-navigation-toolbar-link.vue'
|
|
47
|
+
export { default as UContextMenu } from './context-menu/u-context-menu.vue'
|
|
48
|
+
export { default as UContextMenuLink } from './context-menu-link/u-context-menu-link.vue'
|
|
49
|
+
export { default as UContextMenuDivider } from './context-menu-divider/u-context-menu-divider.vue'
|
|
50
|
+
export { default as UCircularProgress } from './circular-progress/u-circular-progress.vue'
|
|
51
|
+
export { default as UProgressAvatar } from './progress-avatar/u-progress-avatar.vue'
|
|
52
|
+
export { default as UWelcome } from './welcome/u-welcome.vue'
|
|
53
|
+
export { default as UHint } from './hint/u-hint.vue'
|
|
54
|
+
export { default as UNavigationPanelTile } from './navigation-panel-tile/u-navigation-panel-tile.vue'
|
|
55
|
+
export { default as UCardInfo } from './card-info/u-card-info.vue'
|
|
56
|
+
export { default as UFileUpload } from './file-upload/u-file-upload.vue'
|
|
57
|
+
export { default as UBadge } from './badge/u-badge.vue'
|
|
58
|
+
export { default as UDownloadListItem } from './download-list-item/u-download-list-item.vue'
|
|
59
|
+
export { default as UDownloadList } from './download-list/u-download-list.vue'
|
|
60
|
+
export { default as UDataCard } from './data-card/u-data-card.vue'
|
|
61
|
+
export { default as UDataCardGroup } from './data-card-group/u-data-card-group.vue'
|
|
62
|
+
export { default as USearchGroup } from './search-group/u-search-group.vue'
|
|
63
|
+
export { default as USkeletonLoader } from './skeleton-loader/u-skeleton-loader.vue'
|
|
64
|
+
export { default as UCardHighlight } from './card-highlight/u-card-highlight.vue'
|
|
65
|
+
export { default as URating } from './rating/u-rating.vue'
|
|
66
|
+
export { default as UChip } from './chip/u-chip.vue'
|
|
67
|
+
export { default as USlider } from './slider/u-slider.vue'
|
|
68
|
+
export { default as USpriteAnimation } from './sprite-animation/u-sprite-animation.vue'
|
|
69
|
+
export { default as USliderProgressAnimation } from './slider-progress-animation/u-slider-progress-animation.vue'
|
|
70
|
+
export { default as UStickyCta } from './sticky-cta/u-sticky-cta.vue'
|
|
71
|
+
export { default as UNotificationItem } from './notification-item/u-notification-item.vue'
|
|
72
|
+
export { default as UNotificationList } from './notification-list/u-notification-list.vue'
|
|
73
|
+
export { default as UDefinitionList } from './definition-list/u-definition-list.vue'
|
|
74
|
+
export { default as UDefinitionListItem } from './definition-list-item/u-definition-list-item.vue'
|
|
75
|
+
export { default as UCardStatistic } from './card-statistic/u-card-statistic.vue'
|
|
76
|
+
export { default as UEmpty } from './empty/u-empty.vue'
|
|
77
|
+
export { default as UButtonGroup } from './button-group/u-button-group.vue'
|
|
78
|
+
export { default as UPortalLogo } from './portal-logo/u-portal-logo.vue'
|
|
@@ -19,7 +19,7 @@ const headingId = `heading-${editId}`
|
|
|
19
19
|
const panelId = `panel-${editId}`
|
|
20
20
|
const expanded = ref(false)
|
|
21
21
|
const disabled = ref(false)
|
|
22
|
-
const { update, activeEdit } = inject('inline-edit-group', {})
|
|
22
|
+
const { update, activeEdit } = inject('inline-edit-group', { update: null, activeEdit: null })
|
|
23
23
|
|
|
24
24
|
const onEditToggle = () => {
|
|
25
25
|
expanded.value = !expanded.value
|
|
@@ -66,6 +66,13 @@
|
|
|
66
66
|
@include a.type(200, strong);
|
|
67
67
|
|
|
68
68
|
transition: color a.$trs-ease-out;
|
|
69
|
+
|
|
70
|
+
@include a.bp(lg) {
|
|
71
|
+
width: a.rem(192);
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
}
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
.navigation-panel-tile__icon-wrapper {
|
|
@@ -31,7 +31,7 @@ const {
|
|
|
31
31
|
} = defineProps<Slider>()
|
|
32
32
|
|
|
33
33
|
const model = defineModel<number>()
|
|
34
|
-
const emits = defineEmits(['change'])
|
|
34
|
+
const emits = defineEmits(['change', 'release'])
|
|
35
35
|
const id = useId()
|
|
36
36
|
const isSliding = ref(false)
|
|
37
37
|
const isTouch = ref(false)
|
|
@@ -62,7 +62,7 @@ watch(model, () => {
|
|
|
62
62
|
})
|
|
63
63
|
|
|
64
64
|
const onPointerdown = (e: PointerEvent) => {
|
|
65
|
-
if (e.target.closest('.slider__dot')) {
|
|
65
|
+
if ((e.target as HTMLElement).closest('.slider__dot')) {
|
|
66
66
|
return
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -111,6 +111,8 @@ const onPointerup = () => {
|
|
|
111
111
|
|
|
112
112
|
controlEl.value.removeEventListener('pointermove', onPointermove)
|
|
113
113
|
document.removeEventListener('pointerup', onPointerup)
|
|
114
|
+
|
|
115
|
+
emits('release', model.value)
|
|
114
116
|
}
|
|
115
117
|
</script>
|
|
116
118
|
|
|
@@ -3,7 +3,7 @@ import { onMounted, ref, useTemplateRef } from 'vue'
|
|
|
3
3
|
import USlider from '../slider/u-slider.vue'
|
|
4
4
|
import { Slider } from '../slider/u-slider.vue'
|
|
5
5
|
import { Image } from '../../elements/types'
|
|
6
|
-
import { DotLottieVue, setWasmUrl } from '@lottiefiles/dotlottie-vue'
|
|
6
|
+
import { DotLottieVue, DotLottieVueInstance, setWasmUrl } from '@lottiefiles/dotlottie-vue'
|
|
7
7
|
import wasmUrl from '@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm?url'
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
@@ -22,24 +22,28 @@ let lottie = null
|
|
|
22
22
|
const lottieReady = ref(false)
|
|
23
23
|
|
|
24
24
|
const onChange = (value) => {
|
|
25
|
-
|
|
25
|
+
console.log(value)
|
|
26
|
+
lottie.setFrame(Math.max(0, value - 1))
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
onMounted(() => {
|
|
29
|
-
lottie = lottiePlayerRef.value.getDotLottieInstance()
|
|
30
|
+
lottie = (lottiePlayerRef.value as DotLottieVueInstance).getDotLottieInstance()
|
|
30
31
|
|
|
31
32
|
lottie.addEventListener('load', () => {
|
|
32
33
|
lottieReady.value = true
|
|
33
34
|
|
|
34
|
-
//
|
|
35
|
-
|
|
35
|
+
// Don't play animation at all when initial value is 0.
|
|
36
|
+
if (model.value > 0) {
|
|
37
|
+
// Set initial state of animation
|
|
38
|
+
lottie.setSegment(0, model.value)
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
lottie.addEventListener('complete', () => {
|
|
41
|
+
// Reset segment
|
|
42
|
+
lottie.setSegment(0, 100)
|
|
43
|
+
})
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
lottie.play()
|
|
46
|
+
}
|
|
43
47
|
})
|
|
44
48
|
|
|
45
49
|
lottie.addEventListener('ready', () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@mixin table-cell-base {
|
|
4
4
|
display: table-cell;
|
|
5
5
|
padding: var(--e-space-4);
|
|
6
|
-
|
|
6
|
+
height: a.rem(56);
|
|
7
7
|
line-height: 0;
|
|
8
8
|
|
|
9
9
|
@include a.bp(m) {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
display: inline-flex;
|
|
23
23
|
column-gap: var(--e-space-2);
|
|
24
|
-
min-height: a.rem(
|
|
24
|
+
min-height: a.rem(22);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// Horizontal align options
|
|
@@ -80,7 +80,7 @@ const onSpriteReady = () => {
|
|
|
80
80
|
transform: mouseRightSide ? 'scaleX(1)' : 'scaleX(-1)',
|
|
81
81
|
}"
|
|
82
82
|
:spritesheet-path="butterflySprite"
|
|
83
|
-
:frame-positions="butterflySpritePositions"
|
|
83
|
+
:frame-positions="butterflySpritePositions as [number, number][]"
|
|
84
84
|
:frame-width="202"
|
|
85
85
|
:frame-height="300"
|
|
86
86
|
:width="32"
|