Complementary Libraries for Calculated Fields Form

Compatible with CFF: Free Professional Developer Platinum

Complementary Libraries

The "Complementary Libraries" plugin allows using third-party libraries and APIs with CFF forms. The plugin includes some predefined libraries, but it is possible to add new ones.


The "Complementary Libraries" plugin allows using third-party libraries and APIs with CFF forms. The plugin includes some predefined libraries, but it is possible to add new ones.

The "Calculated Fields Form" plugin includes mathematical, financial, date/time, graphical, and distance operations. However, for some projects, the plugin operation may not be sufficient, or you may feel more comfortable using other APIs with which you are familiar. The "Complementary Libraries" plugin allows you to include third-party libraries with Calculated Field Forms to use their operations or functionalities. The "Complementary Libraries" plugin pauses the evaluation of the equations associated with calculated fields until the third-party libraries are loaded and ready to use.

The "Complementary Libraries" plugin includes some predefined libraries that you can select from the form settings:

  • AnimeJS (JavaScript animation library with a simple, yet powerful API)
  • Chart.js (JavaScript charting for designers & developers)
  • Cleave.js (Formatting the contents of input tags while typing)
  • Formula.js (JavaScript implementation of most Microsoft Excel formula functions)
  • Leaflet (JavaScript library for mobile-friendly interactive maps)
  • Lodash (JavaScript utility library delivering modularity, performance & extras)
  • Math.js (Extensive math library)
  • MathJax (Display engine for mathematics)
  • Moment.js (Parse, validate, manipulate, and display dates and times in JavaScript)
  • Vocajs (JavaScript string library)

If your project needs additional libraries or different versions of the predefined ones, go to the menu option: "Calculated fields form > Complementary libraries" to add new libraries or edit existing ones.

After adding new complementary libraries, you can select them from the form settings.

Ex. After selecting the Math.js library in the form configuration, you could calculate operations with complex numbers. Inserting a calculated field in the form and entering the equation:

math.add(math.complex('5 + 3i'), math.complex('3-7i'))

You will get the result:

8 - 4i

The "Complementary Libraries for Calculated Fields Form" plugin installation process is similar to other plugins in WordPress. Download the zip file with the plugin's code to your computer (visiting the download link provided after purchasing), and follow the steps below:

  1. Go to the Plugins section on your WordPress.
  2. Press the "Add New" button at the top of the Plugins section.
  3. Press the "Upload Plugin" button and select the zipped file downloaded previously.
  4. Finally, install and activate the plugin.

The plugin includes the menu option "Calculate Fields Form > Complementary Libraries."

The new page allows you to register your copy of the plugin to receive the updates directly on your WordPress instead of downloading and installing them manually. Furthermore, it includes a section to manage the libraries, allowing you to add new libraries, edit the existing ones, or delete those libraries that become unnecessary. Finally, through the plugin's page, it is possible to deactivate it completely, deleting its database and options.

To register the plugin, you should go to the menu option "Calculated Fields Form > Complementary Libraries" enter the email address used to purchase the plugin and press the "Register" button.

Registration Section
Plugin Registration.

The settings page of the plugin, accessible through the menu option "Calculated Fields Form > Complementary Libraries," includes the list of libraries distributed with the plugin and your added libraries.

Complementary Libraries Section
Complementary Libraries Section.

The plugin allows you to add new libraries and edit or delete existing ones. Deleting a library disables it from all forms that use it. Or editing the resources of a library updates them in all forms at once.

The plugin settings page includes a section for entering additional libraries or editing them.

Add Library
Add Library.
Updating Library
Updating Library.

The use of the "Complementary Libraries for Calculated Fields Form" plugin depends on every library.

The plugin includes a new section in the form settings that contains the drop-down list of available libraries. Just select the libraries to use from the form, and save the form configuration.

The plugin allows selecting multiple libraries in the same form.

Form Settings
Form Settings.

For example, assuming you selected the Moment.JS library through form settings, you could implement equations that use moment methods. Like the equation:

moment().format("[Today is] dddd");

Whose output would have the format: Today is Monday

The same result without the Moment.JS library would require a complex equation:


(function(){
	var date = TODAY(),
		week_day = WEEKDAY(date),
		days = {1:'Sunday', 2:'Monday', 3:'Tuesday', 4:'Wednesday', 5:'Thursday', 6:'Friday', 7:'Saturday'};
	return CONCATENATE('Today is ', days[week_day]);
})()

The Complementary Libraries plugin covers the integration with third-party APIs or libraries, and we would be pleased to answer all your questions about it. However, questions regarding each particular API or library should be directed to their respective developers.

Screenshots

Plugin Registration
Plugin Registration.
Complementary Libraries Section
Complementary Libraries Section.
Add Library
Add Library.
Update Library
Update Library.
Form Settings
Form Settings.

14.99€

One time purchase

Details

Version 1.0.2
Last updated 2024/02/12

Compatibility

CFF Free All versions
CFF Professional All versions
CFF Developer All versions
CFF Platinum All versions
Tested up to WP 6.5