From 3df5eeb2c8efcf938d1361377d0d509e85324d61 Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Tue, 26 Nov 2024 15:35:46 +0600 Subject: [PATCH] compatibility for settings and notification tab --- .../js/components/builder-stage/template.php | 3 +- admin/form-builder/assets/js/form-builder.js | 16 ++++++- admin/form-builder/views/form-builder.php | 35 +++++++++++++-- assets/js-templates/form-components.php | 3 +- assets/js/wpuf-form-builder.js | 16 ++++++- includes/Admin/Forms/Admin_Form.php | 44 +++++++++++-------- 6 files changed, 87 insertions(+), 30 deletions(-) diff --git a/admin/form-builder/assets/js/components/builder-stage/template.php b/admin/form-builder/assets/js/components/builder-stage/template.php index 4471b0c4..15916140 100644 --- a/admin/form-builder/assets/js/components/builder-stage/template.php +++ b/admin/form-builder/assets/js/components/builder-stage/template.php @@ -188,6 +188,5 @@ class="wpuf-rounded-r-md hover:wpuf-bg-slate-500 hover:wpuf-cursor-pointer wpuf- - - + diff --git a/admin/form-builder/assets/js/form-builder.js b/admin/form-builder/assets/js/form-builder.js index de09f3c4..324a4585 100644 --- a/admin/form-builder/assets/js/form-builder.js +++ b/admin/form-builder/assets/js/form-builder.js @@ -414,6 +414,7 @@ enableMultistep: false, shortcodeCopied: false, active_tab: 'form-editor', + active_settings_tab: '#wpuf-metabox-settings', logoUrl: wpuf_form_builder.assetUrl + '/images/wpuf-icon-circle.svg' }, @@ -475,11 +476,18 @@ }, mounted: function () { + // secondary settings tabs and their contents + var settings_tabs = $('#wpuf-form-builder-settings-tabs .nav-tab'); + var self = this; + + // add a click listener to each settings_tab + settings_tabs.each(function () { + $(this).bind('click', self.setActiveSettingsTab ); + }); + var clipboard = new window.Clipboard('.form-id'); $(".form-id").tooltip(); - var self = this; - clipboard.on('success', function(e) { // Show copied tooltip $(e.trigger) @@ -506,6 +514,10 @@ }, methods: { + setActiveSettingsTab: function (e) { + this.active_settings_tab = $(e.target).attr('href'); + }, + // switch form switch_form: function () { this.is_form_switcher = (this.is_form_switcher) ? false : true; diff --git a/admin/form-builder/views/form-builder.php b/admin/form-builder/views/form-builder.php index d020abf1..76926168 100644 --- a/admin/form-builder/views/form-builder.php +++ b/admin/form-builder/views/form-builder.php @@ -1,5 +1,7 @@
+ class="wpuf-w-[calc(100%+20px)] wpuf-ml-[-20px] wpuf-form-builder-" + method="post" + action="" @submit.prevent="save_form_builder" v-cloak>
@@ -121,7 +123,6 @@ class="wpuf-nav-tab wpuf-nav-tab-active wpuf-text-gray-800 wpuf-py-2 wpuf-px-4 w class="wpuf-nav-tab wpuf-nav-tab-active wpuf-text-gray-800 wpuf-py-2 wpuf-px-4 wpuf-text-sm hover:wpuf-bg-white hover:wpuf-text-gray-800 hover:wpuf-rounded-md hover:wpuf-drop-shadow-sm focus:wpuf-shadow-none"> -
@@ -145,10 +146,38 @@ class="wpuf-pointer-events-none wpuf-absolute wpuf-left-0 wpuf-inline-block wpuf
-
+
Field attributes
+
+
+ +
+
+
+ +
+
+
+ + + + + + + + + diff --git a/assets/js-templates/form-components.php b/assets/js-templates/form-components.php index 20b4ccaf..13f33585 100644 --- a/assets/js-templates/form-components.php +++ b/assets/js-templates/form-components.php @@ -189,9 +189,8 @@ class="wpuf-rounded-r-md hover:wpuf-bg-slate-500 hover:wpuf-cursor-pointer wpuf-
- - +