From 5bd8bf2f56da11454792722d111b8645d5b3ec39 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Tue, 10 Feb 2026 01:11:23 +0000 Subject: [PATCH] init --- lnbits/static/js/components/linbits-dialog.js | 85 +++++++++++++++++++ lnbits/templates/components/lnbits-dialog.vue | 48 +++++++++++ 2 files changed, 133 insertions(+) create mode 100644 lnbits/static/js/components/linbits-dialog.js create mode 100644 lnbits/templates/components/lnbits-dialog.vue diff --git a/lnbits/static/js/components/linbits-dialog.js b/lnbits/static/js/components/linbits-dialog.js new file mode 100644 index 000000000..c12c6482b --- /dev/null +++ b/lnbits/static/js/components/linbits-dialog.js @@ -0,0 +1,85 @@ +window.app.component('lnbits-dialog', { + template: '#lnbits-dialog', + + props: { + show: { + type: Boolean, + required: true + }, + title: { + type: String, + default: '' + }, + position: { + type: String, + default: 'top' + }, + persistent: { + type: Boolean, + default: true + }, + showCancel: { + type: Boolean, + default: true + }, + cancelLabel: { + type: String, + default: 'Close' + }, + cancelColor: { + type: String, + default: 'grey' + }, + showConfirm: { + type: Boolean, + default: false + }, + confirmLabel: { + type: String, + default: 'Confirm' + }, + confirmColor: { + type: String, + default: 'primary' + }, + confirmOutline: { + type: Boolean, + default: false + }, + confirmFlat: { + type: Boolean, + default: false + }, + confirmLoading: { + type: Boolean, + default: false + }, + confirmDisable: { + type: Boolean, + default: false + } + }, + + emits: ['update:show', 'hide', 'cancel', 'confirm'], + + computed: { + hasActionsSlot() { + return !!this.$slots.actions + } + }, + + methods: { + handleHide() { + this.$emit('update:show', false) + this.$emit('hide') + }, + + handleCancel() { + this.$emit('cancel') + }, + + handleConfirm() { + this.$emit('confirm') + } + } +}) diff --git a/lnbits/templates/components/lnbits-dialog.vue b/lnbits/templates/components/lnbits-dialog.vue new file mode 100644 index 000000000..8ed3d9f86 --- /dev/null +++ b/lnbits/templates/components/lnbits-dialog.vue @@ -0,0 +1,48 @@ +