forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: optimize JavaScript bundle (evcc-io#5495)
- Loading branch information
Showing
26 changed files
with
1,933 additions
and
2,222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ fly.toml | |
.idea | ||
vendor/* | ||
QEMU_EFI.fd | ||
asset-stats.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,46 @@ | ||
<template> | ||
<number :to="to" :format="format" :duration="animationDuration" /> | ||
<span /> | ||
</template> | ||
|
||
<script> | ||
import { CountUp } from "countup.js"; | ||
const DURATION = 0.5; | ||
export default { | ||
name: "AnimatedNumber", | ||
props: { | ||
to: { type: Number }, | ||
format: { type: Function }, | ||
noAnimation: { type: Boolean }, | ||
format: { type: Function, required: true }, | ||
duration: { type: Number, default: DURATION }, | ||
}, | ||
data() { | ||
return { activeDuration: 0 }; | ||
}, | ||
computed: { | ||
animationDuration() { | ||
return this.noAnimation ? 0 : this.activeDuration; | ||
}, | ||
return { | ||
instance: null, | ||
}; | ||
}, | ||
watch: { | ||
to: function () { | ||
this.activeDuration = this.duration; | ||
to(value) { | ||
this.instance?.update(value); | ||
}, | ||
}, | ||
mounted() { | ||
if (this.instance) { | ||
return; | ||
} | ||
this.instance = new CountUp(this.$el, this.to, { | ||
startVal: this.to, | ||
formattingFn: this.format, | ||
duration: this.duration, | ||
decimalPlaces: 2, | ||
}); | ||
if (this.instance.error) { | ||
console.error(this.instance.error); | ||
} | ||
}, | ||
unmounted() { | ||
this.instance = null; | ||
}, | ||
}; | ||
</script> | ||
<style lang="less" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
<template> | ||
<button | ||
type="button" | ||
data-bs-toggle="modal" | ||
:data-bs-target="`#loadpointSettingsModal_${id}`" | ||
class="btn btn-sm btn-outline-secondary position-relative border-0 p-2 evcc-gray" | ||
@click="openModal" | ||
> | ||
<shopicon-regular-adjust size="s"></shopicon-regular-adjust> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
import "@h2d2/shopicons/es/regular/adjust"; | ||
import Modal from "bootstrap/js/dist/modal"; | ||
export default { | ||
name: "LoadpointSettingsButton", | ||
props: { | ||
id: [String, Number], | ||
}, | ||
methods: { | ||
openModal() { | ||
const modal = Modal.getOrCreateInstance( | ||
document.getElementById(`loadpointSettingsModal_${this.id}`) | ||
); | ||
modal.show(); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.