jSuites is a collection of lightweight common required javascript web components. It is composed of fully responsive vanilla plugins to help you bring the best user experience to your projects, independent of the platform. Same JS codebase across different platforms.

Overview

The javascript web components

jSuites v4 - Webcomponents and JavaScript plugins.

About

jSuites is a collection of lightweight common required javascript web components. It is composed of fully responsive javascript vanilla plugins to help you bring the best user experience to your projects, independent of the platform.

The first version includes several common javascript tools in various frontend applications. jSuites is fully and easily integrated with any framework and tools. The first collection brings the following plugins:

  • Nice clean and responsive javascript calendar, date and time picker. This is integrated with jExcel and bring flexibility and responsiveness to your apps and web-based systems;
  • Our multi-purpose dropdown aims to give the user the best experience picking one or more options from a list. With a simple directive, you can render that in different modes, such as select box, search bar, mobile picker or a simple list.
  • The form tracker will give the chance to track changes from basic to highly dynamic forms in order to remember the user to save their form changes before leaving the page. This is basically the "Are you sure"? javascript plugin.
  • A simple color picker
  • A very straight forward responsive image thumb view
  • A great responsive data timeline
  • A simple modal, input mask javascript, mini HTMLeditor and some mobile common web components

Highlights

jSuites brings the developer many advantages, such as:

  • Make rich and user-friendly web interfaces and applications
  • You can easily handle complicated data inputs in a way users are used to
  • Improve your clients software experience
  • Create rich CRUDS and beautiful UI
  • Lean, fast and simple to use
  • One code, multiple platform

Basic demo

Create a multiple and autocomplete responsive dropdown.

<html>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

<div id="dropdown1"></div>

<script>
jSuites.dropdown(document.getElementById('dropdown1'), {
    data:[
        'City of London',
        'City of Westminster',
        'Kensington and Chelsea',
        'Hammersmith and Fulham', // (...)
        ],
    autocomplete:true,
    multiple:true,
    width:'280px',
});
</script>
</html>

The same code can render in different ways, by directive type: default, picker or searchbar
Javascript dropdown

Examples

Official website

Community

Copyright and license

jSuites is released under the [MIT license].

Contact

[email protected]

Comments
  • Edit Existing Calendar Issue breaks year

    Edit Existing Calendar Issue breaks year

    using the following for a column: {type: 'calendar', title: 'BLD Date', width: 170, options: {format:'MM/DD/YYYY HH24:MI', time:true, today:1,resetButton:true,placeholder:'DD/MM/YYYY',}

    If the field was blank, pulling up the calendar works fine. If a previous value is in the cell, and the calendar is brought up, it goes to year 0002 image

    opened by wescrockett 6
  • Date to string conversion

    Date to string conversion

    I've tracked down this related issue in jExcel and I figured out that it could be solved quite easily in jsuites.js:

    // Helper to convert date into string
    jSuites.calendar.getDateString = function(value, format) {
        ...
        if (value) {
            var d = ''+value;
            // instead of:
            // d = d.split(' ');
            var splitStr = (d.indexOf('T') !== -1) ? 'T' : ' ';
            d = d.split(splitStr);
           ...
    

    I'll be glad to do a PR but I'm also facing a mixed line endings problem like in #34.

    opened by paulbriton 4
  • mask.run turns 0 into

    mask.run turns 0 into ""

    I see now there is a PR for this already: #17, but this is the issue

    jSuites.mask.run(1, "#.#", decimal)
    // ==> 1
    
    jSuites.mask.run(1, "0.0", decimal) 
    // ==> ""
    
    opened by tdamsma 4
  • rgba called with wrong number of arguments

    rgba called with wrong number of arguments

    I'm including jExcel in a Svelte app and getting an error from Sass about rgba being called with the wrong number of arguments. It looks like the problem is at line 2889 of dist/jsuites.css, it should either use rgb() or add the 4th argument to the rgba() call. Also, line 2888 appears to have a typo, 'backgroun-color' instead of 'background-color'.

    opened by mercurio 4
  • Number mask for negative values

    Number mask for negative values

    I was able to use number mask for positive values. But for negative values, it removes the negative sign. The mask works perfectly. Is there a way to retain the negative sign? I am using the mask in Jexcel CE (Jexcel V3).

    opened by vanglian 4
  • Control modal separately

    Control modal separately

    I have the following issue: When I create the first modal, everything works fine, but when I open the second one, and I want to move or close the first one I get undefined, it is like the second modal overrides the first one, and I have to close the second one and open the first to gain control again. The content of both modals works fine with both modals open at the same time, it is just the onclose function that doesn´t work and the option to move it with the mouse

    So my question is: is there a way to have like to different instance of a modal?

    I had tried using as a WebComponent and as the Basic example ezgif com-gif-maker (5)

    opened by francofgp 3
  • Security vulnerability report

    Security vulnerability report

    Hello,

    The GitHub Security Lab team has found a potential vulnerability in jSuites text editor. We tried contacting [email protected] but got the email bounced. Please create a Security Advisory and invite me (pwntester) in to further disclose and discuss the vulnerability details and potential fix. Alternatively, please add a Security Policy containing a security email address to send the details to.

    If you prefer to contact us by email, please reach out to [email protected] with reference to GHSL-2021-1002.

    Kind regards, Alvaro Muñoz GitHub Security Lab

    opened by pwntester 3
  • Masked input has no paste ability

    Masked input has no paste ability

    After:

    document.addEventListener('keydown', function(e) {
        if (jSuites.mask) {
            jSuites.mask.apply(e);
        }
    });
    

    Add something like:

    document.addEventListener('paste', function(e) {
        if (jSuites.mask) {
            jSuites.mask.applyClipboard(e);
        }
    });
    

    And add a function like:

    obj.applyClipboard = function(e) {
    	
    	if (e.target && ! e.target.getAttribute('readonly')) {
    		var mask = e.target.getAttribute('data-mask');
    		if (mask) {		  
    			// Prevent default
    			e.preventDefault();
    			
    			var fromClipbord = (e.clipboardData || window.clipboardData).getData('text').split('');
    			// Loop for apply
    			for (var iii = 0; iii < fromClipbord.length; iii++) {
    				
    				index = 0;
    				values = [];
    				// Create mask token
    				obj.prepare(mask);
    				// Current value
    				var currentValue = '';
    				// Process selection
    				if (e.target.tagName == 'DIV') {
    					if (e.target.innerText) {
    						var s = window.getSelection();
    						if (s && s.anchorOffset != s.focusOffset) {
    							var offset = s.anchorOffset > s.focusOffset ? s.focusOffset : s.anchorOffset;
    							var currentValue = e.target.innerText.substring(0, offset);
    							} else {
    							var currentValue = e.target.innerText;
    						}
    					}
    					} else {
    					if (e.target.selectionStart < e.target.selectionEnd) {
    						var currentValue = e.target.value.substring(0, e.target.selectionStart); 
    						} else {
    						var currentValue = e.target.value;
    					}
    				}
    				
    				if (currentValue) {
    					// Checking current value
    					for (var i = 0; i < currentValue.length; i++) {
    						if (currentValue[i] != null) {
    							obj.process(currentValue[i]);
    						}
    					}
    				}
    				
    				// Process input
    				var ret = obj.process( fromClipbord[iii] );
    				
    				// New value 
    				var value = values.join('');
    				
    				// Update value to the element
    				if (e.target.tagName == 'DIV') {
    					if (value != e.target.innerText) {
    						e.target.innerText = value;
    						// Set focus
    						jSuites.focus(e.target);
    					}
    					} else {
    					e.target.value = value;
    				}
    				
    				// Completed attribute
    				if (pieces.length == values.length && pieces[pieces.length-1].length == values[values.length-1].length) {
    					e.target.setAttribute('data-completed', 'true');
    					} else {
    					e.target.setAttribute('data-completed', 'false');
    				}
    			}
    		}
    	}
    }
    
    opened by SleepyFly 3
  • Toolbar Suggestions

    Toolbar Suggestions

    Here are some suggestions for the toolbar for future reference

    1. Allow state. For example, assume there is a cell is set to "bold". And assume that you click away on another cell, and then you click back on the original cell again, then the "bold" button would appear pressed when clicking back on the original cell

    2. Allow custom icons in the toolbar (allow users to use their own icons).

    3. Allow text instead of an icon for toolbar buttons.

    opened by wahabmirjan 3
  • Wrong class name on context menu?

    Wrong class name on context menu?

    I tried the disabled option and tried to make it look disabled, but it still had the same color as the rest.

    https://github.com/paulhodel/jsuites/blob/e5445d63065f3c8f5422dd0b57a147d11fd1eed1/dist/jsuites.js#L2169-L2171

    Looking at your well written source code (since the documentation is so bad) I found out that you add the class jcontextmenu-disabled to disabled items, but there is no css selector that match that name.

    https://github.com/paulhodel/jsuites/blob/e5445d63065f3c8f5422dd0b57a147d11fd1eed1/dist/jsuites.css#L1487-L1489

    opened by jimmywarting 3
  • Using git tags when releasing new versions

    Using git tags when releasing new versions

    Hi,

    it would be nice if you could use git tag to the corresponding tag when you release a new version, e.g.:

    git tag -a -m "Tagging version 3.1.0.' v3.1.0 git push --tags

    This would make following/tracking updates on jsuites so much easier.

    Regards, Daniel

    opened by daniel-baumann 3
  • Copy Paste XSS in JSuite

    Copy Paste XSS in JSuite

    Hi team, I have tried contacting You via Mail [email protected] but it does not work and bounce back.

    Im bit new to this Issue Raise via Giithub. Can i share the Issue Details here (Or) Do you have any other medium to raise issue. If yes kindly add me into it will share further Details there to avoid exposing it in public

    opened by Ameenbasha111 0
  • AJAX Custom Header Causes CORS to Fail

    AJAX Custom Header Causes CORS to Fail

    I recently encountered this issue when attempting to load a csv file on another domain by jSpreadsheet. The request to fetch the csv file failed even when the other server (say, GitHub Gist raw data) has Access-Control-Allow-Origin set to *.

    A more careful look at the error log suggests that jSpreadsheet uses this library's AJAX module to load CSV file. However, on the following segment of code, a custom header of X-Requested-With is set. Further down the code, to avoid hitting a cache some other headers were also set, but that could be worked around without much effort so it is out of scope.

    https://github.com/jsuites/jsuites/blob/master/src/ajax.js#L105

    According to MDN, X-Requested-With is not part of the safelisted request headers (Accept, Accept-Language, Content-Language, Content-Type. ), thus this causes the request, despite being a simple GET, need a CORS preflight to complete. As the other website does not recognize the additional unsafe headers, the preflight failed and I failed to get the data from them.

    I worked around this issue by manually create a XHR to obtain the data, then feed the data into a csv parser and into jSpreadsheet. However that just looks ugly when comparing to the alternative of specifying the csv's address on initialization of jSpreadsheet and get things done.

    Now I wonder, is there any reasoning behind setting such custom header when doing any XHR request from the AJAX module of this library, such as not allowing anyone to use such library to access anything that is outside of their origin? Is there any method to not set such headers that are not safelisted when doing an AJAX request?

    opened by StephDC 0
  • HTML Editor -

    HTML Editor - "acceptImage: false" is not working on PASTE

    The property options.acceptImages is not checked in two places before calling addImage() in the code for the HTML Editor:

    • extractImageFromHtml()
    • addFile()

    I would propose that the addImage() function be modified to check the options.acceptImages at the start of the function:

      obj.addImage = function(src, asSnippet) {
            if (! obj.options.acceptImages) {
                return;
            }
    

    Might be a good idea in addPdf() to add a similar check of options.acceptFiles at the top of the functions.

    Not sure if adding a similar check to addFile() would be a good idea?

    opened by gtasker10 0
  • Function keyUpControls in calendar cause problems for YYYY-DD-MM date format

    Function keyUpControls in calendar cause problems for YYYY-DD-MM date format

    In calendar when readonly is set to false and user can manually enter date, this check doesn't work properly when date format is set to YYYY-MM-DD. When you try enter eg. 2022 calendar automatically set different date.

    It works properly when below function will be change from:

    var keyUpControls = function(e) { if (e.target.value && e.target.value.length > 3) { var test = jSuites.calendar.extractDateFromString(e.target.value, obj.options.format); if (test) { obj.setValue(test); } } }

    to:

    var keyUpControls = function(e) { if (e.target.value && e.target.value.length == 10) { var test = jSuites.calendar.extractDateFromString(e.target.value, obj.options.format); if (test) { obj.setValue(test); } } }

    or dateformat.length instead of 10.

    opened by dawid520 0
  • Tag Suggestion Component  / Cannot read properties of null (reading 'tagName')

    Tag Suggestion Component / Cannot read properties of null (reading 'tagName')

    This problem occurs in the component implementation, and also in the example page.

    https://jsuites.net/v4/javascript-tags/remote-search

    Console message:

    jsuites.js:10143 Uncaught TypeError: Cannot read properties of null (reading 'tagName') at jSuites.search.obj.keyup (jsuites.js:10143:35) at HTMLDivElement.tagsKeyUp (jsuites.js:11603:24) jSuites.search.obj.keyup @ jsuites.js:10143 tagsKeyUp @ jsuites.js:11603

    PS. Release 4.9.11 works

    opened by tsugawa 2
Releases(v4.17.5)
Simple autocomplete pure vanilla Javascript library.

autoComplete.js ✨ Simple autocomplete pure vanilla Javascript library. ?? Live Demo v8.3 autoComplete.js is a simple pure vanilla Javascript library t

Tarek 3.7k Dec 31, 2022
Everything you wish the HTML