From 16356d8a5c4c60e5ced65ab159383023cab2fcf9 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Tue, 4 Jul 2023 10:42:06 +0200 Subject: [PATCH 1/3] reverse order setColumns & setData --- public/js/components/filter/Filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index 776405614..453face96 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -226,9 +226,9 @@ export const CoreFilterCmpt = { } }, _updateTabulator() { - this.tabulator.setData(this.filteredData); this.tabulatorHasSelector = this.filteredColumns.filter(el => el.formatter == 'rowSelection').length; this.tabulator.setColumns(this.filteredColumns); + this.tabulator.setData(this.filteredData); }, /** * From 3798720ee0ed5fe1a42e0240ac7fd7ffbfa6ecc9 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Tue, 4 Jul 2023 14:38:20 +0200 Subject: [PATCH 2/3] +emit: click:new --- public/js/components/filter/Filter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index 453face96..2b6a4fe6d 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -39,7 +39,8 @@ export const CoreFilterCmpt = { TableDownload }, emits: [ - 'nwNewEntry' + 'nwNewEntry', + 'click:new' ], props: { onNwNewEntry: Function, // NOTE(chris): Hack to get the nwNewEntry listener into $props From 539efcb6ecfeb0d9e54d9a4d07949964b268bb87 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 6 Jul 2023 12:03:38 +0200 Subject: [PATCH 3/3] added Modal.js to Bootstrap components --- public/js/components/Bootstrap/Modal.js | 109 ++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 public/js/components/Bootstrap/Modal.js diff --git a/public/js/components/Bootstrap/Modal.js b/public/js/components/Bootstrap/Modal.js new file mode 100644 index 000000000..90cec2d50 --- /dev/null +++ b/public/js/components/Bootstrap/Modal.js @@ -0,0 +1,109 @@ +export default { + data: () => ({ + modal: null + }), + props: { + backdrop: { + type: [Boolean,String], + default: true, + validator(value) { + return ['static', true, false].includes(value); + } + }, + focus: { + type: Boolean, + default: true + }, + keyboard: { + type: Boolean, + default: true + }, + noCloseBtn: Boolean, + dialogClass: [String,Array,Object] + }, + emits: [ + "hideBsModal", + "hiddenBsModal", + "hidePreventedBsModal", + "showBsModal", + "shownBsModal" + ], + methods: { + dispose() { + return this.modal.dispose(); + }, + handleUpdate() { + return this.modal.handleUpdate(); + }, + hide() { + return this.modal.hide(); + }, + show(relatedTarget) { + return this.modal.show(relatedTarget); + }, + toggle() { + return this.modal.toggle(); + } + }, + mounted() { + if(this.$refs.modal) + { + this.modal = new bootstrap.Modal(this.$refs.modal, { + backdrop: this.backdrop, + focus: this.focus, + keyboard: this.keyboard + }); + } + }, + popup(body, options, title, footer) { + const BsModal = this, + slots = {}; + if (body !== undefined) + slots.default = () => body; + if (title !== undefined) + slots.title = () => title; + if (footer !== undefined) + slots.footer = () => footer; + return new Promise((resolve,reject) => { + const instance = Vue.createApp({ + setup() { + return () => Vue.h(BsModal, {...{ + class: 'fade' + },...options, ...{ + ref: 'modal', + 'onHidden.bs.modal': instance.unmount + }}, slots); + }, + mounted() { + this.$refs.modal.show(); + }, + beforeUnmount() { + if (this.$refs.modal) + this.$refs.modal.result !== false ? resolve(this.$refs.modal.result) : reject(); + }, + unmounted() { + wrapper.parentElement.removeChild(wrapper); + } + }); + const wrapper = document.createElement("div"); + instance.mount(wrapper); + document.body.appendChild(wrapper); + }); + }, + template: `` +}