From 4425e912aba0fdde258fcedbb6d4ea57398f3fca Mon Sep 17 00:00:00 2001 From: Afiq Date: Thu, 7 Aug 2025 21:24:03 +0800 Subject: [PATCH] Enhance Form Script Engine with New Field Functions and Notification Improvements - Added new functions to the FormScriptEngine for enhanced field manipulation: setFieldByLabel() for setting fields by their display label, and getFieldOptions() for retrieving available options for select, radio, and checkbox fields. - Improved the setField() function to handle various field types more robustly, including select, radio, checkbox, and range inputs, with better event triggering for reactive updates. - Enhanced notification functions (showSuccess, showError, showInfo) to utilize Vue Toastification for improved user feedback, including customizable options for toast notifications. - Updated documentation in the form builder to reflect new field helper functions and their usage, improving developer guidance and usability. --- components/FormBuilderFieldSettingsModal.vue | 2 +- components/FormScriptEngine.vue | 536 ++++++++++++++++++- docs/form-javascript-api.md | 443 +++++++++++++++ pages/form-builder/index.vue | 23 +- 4 files changed, 980 insertions(+), 24 deletions(-) create mode 100644 docs/form-javascript-api.md diff --git a/components/FormBuilderFieldSettingsModal.vue b/components/FormBuilderFieldSettingsModal.vue index 2fc94fd..118ff5f 100644 --- a/components/FormBuilderFieldSettingsModal.vue +++ b/components/FormBuilderFieldSettingsModal.vue @@ -778,7 +778,7 @@
- Available functions: getField(), setField(), showField(), hideField(), enableField(), disableField(), showSuccess(), showError(), showInfo() + Available functions: getField(), setField(), setFieldByLabel(), getFieldOptions(), showField(), hideField(), enableField(), disableField(), showSuccess(), showError(), showInfo(), showWarning(), showConfirm(), showToast()