GithubHelp home page GithubHelp logo

jsuites / jsuites Goto Github PK

View Code? Open in Web Editor NEW
484.0 14.0 66.0 3.96 MB

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.

Home Page: https://jsuites.net

License: MIT License

JavaScript 78.18% CSS 21.71% HTML 0.11%
javascript javascript-library javascript-tools javascript-plugin webcomponents plugins

jsuites's Introduction

The javascript web components

jSuites v5 - 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/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/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]

Other tools

jsuites's People

Contributors

awesomerobot avatar darkxst avatar deftdawg avatar gbonnaire avatar gessielsp avatar hodeware avatar joaovmvini avatar klren0312 avatar nicolasjesse avatar pphod avatar ruan-miguel avatar thieum avatar vishnutsivan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsuites's Issues

submenu in contextmenu

would like to have a submenu in the context menu so you can group something under one item.

is it possible, how can i accomplish that?

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');
				}
			}
		}
	}
}

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).

for every element with attribute data-href in my page even it is not related to Jexcel, actionUpControl invoke jSuites.pages(link).

obj.actionUpControl = function(e) {
        var element = null;
        if (element = jSuites.getLinkElement(e.target)) {
            var link = element.getAttribute('data-href'); //this line is invoking for all of my element with data-href
            if (link == '#back') {
                window.history.back();
            } else if (link == '#panel') {
                jSuites.panel();
            } else {
                jSuites.pages(link);
            }
        }

    }

The function actionUpControl invoke jSuites.pages(link), for every element with attribute data-href in my page even it is not related to Jexcel.

I think it should only get invoked for specific elements which are using Jsuites or Jexcel
kindly look into this issue

Select & Edit

Hi,
i love your jsuites.
i have a question about drop-box.
Is there any way to use drop-box(select) & write together?
I know you support New Options.. but i want little bit different.
i want to select dropbox and write text about cells.
so if you support this function, could you please let me know about it?
Thank you.

hh24 not working

Hello, please check hh24 issue, for ex; data-mask='yyyy-mm-dd hh24:mi'

No documentation?

I see the examples but no clear API for the web components. Am I missing where the API/documentation is?

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

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.

Dropdown

Create from a HTML select element.

autocomplete:true for groups and titles

Is it possible to use autocomplete also for groups and titles.
I think it worked in older jsuites version.

<html>
<script src="https://bossanova.uk/jsuites/v2/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v2/jsuites.css" type="text/css" />
<div id="dropdown2"></div>
<script>
jSuites.dropdown(document.getElementById('dropdown2'), {
    data:[
        { group:'Breads', id:'1', name:'Wholemeal', title: 'Aaa' },
        { group:'Breakfast Cereals', id:'2', name:'Wholegrain', title: 'Bbb' },
        { group:'Grains', id:'3', name:'White', title: 'Ccc' }
        ],
    autocomplete: true,
    width:'280px',
});
</script>
</html>

Uncaught DOMException on jSuites.loading.hide

Hi !
in jSpreadsheet, with the loadingSpin activated, I see an error in the javascript console when jSuites try to hide the loadingSpin :
Uncaught DOMException : The node to be removed is not a child of this node
Apparently, the code passes twice in the hide() function, so first time document.body.removeChild(loading); works, but second time (loading element still exists but is no longer a child of body element) it triggers the error.
A simple workaround is to modify the test in the hide() function : I replaced if (loading) by if (loading && loading.parentElement), maybe it could be integrated.
Bests,

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'.

getData([]) unable to work for me.

When I'm trying to feel static data in jsuites sheel. And feel data manually the in sheet then how to get cell value and cell id. Please help me to solve this.

change event not working

Hello, i'm trying to use jsuites dropdown into a webpack but i dont succeed to use events...
Is there a mistake ?

this.dropdown = jSuites.dropdown(this.input, {
      data: countries,
      autocomplete: true,
      multiple: this.schema.multiple,
      lazyLoading: true,
      type: this.schema.typeInput,
      width: this.schema.width,
    });

    this.addEventListener(this.dropdown, 'change', () => {
      console.log("updated")
      this.updateValue()
    })

Add Synonyms to dropdown autocomplete search (Feature Request)

Feature Request:
When supplying the data for a dropdown, it would be very helpful to be able to include a synonym array that could be used to filter items when using the autocomplete feature. For instance, an entry in a countries list might be:

{"id":"US","name":"United States of America","synonym":["USA","US","America","USofA"]}

autocomplete dropdown data index value

Hi @paulhodel
I have seen https://bossanova.uk/jtools/dropdown-and-autocomplete, but I can't find how to set the drop-down data index value. can you help me?

I need set drop-down data index value, like as below
<div id="dropdown4"></div>
<script> myDropdown = jApp.dropdown(document.getElementById('dropdown4'), {
data:[
{ indexValue:'13', name:'apple' },
{ indexValue:'15', name:'mango'},
],
onchange:function(el,val) {
document.getElementById('log').innerHTML = 'Dropdown new value is: ' + val;
//When I selected apple this should be show 'Dropdown new value is: 13'
},
});
</script>

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

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) 
// ==> ""

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.

jsuite CSS rgb function change to rgba

4 argument passed into rgb function instead of 3. Typescript expects exact number of arguments to be passed(works in pure JS). Project build failing due to this. Request to please change the function to rgba.

ERROR in ./node_modules/jsuites/dist/jsuites.css (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/jsuites/dist/jsuites.css)
Module build failed:
background: rgb(255,255,255,0.95);

Time of 00 minutes will not stick after reopening the calendar

When using the DateTime picker if the minutes dropdown is set to 00 it will update the appropriate text box, however, on reopening the picker the minutes dropdown will revert to the current time.

This is viewable in the "Datetime picker" example on your site https://bossanova.uk/jsuites/date-and-datetime-picker

Steps to recreate:
Pick 12:00 leaving the date as default then click update, the text box changes to 2019-08-14 12:00 as expected.
Reopening the picker now shows 12:33 (or whatever the current minute is).
Changing the time to 12:05 and clicking update changes the text box to 2019-08-14 12:05.
Reopening the pick still shows 12:05 as expected.

Rollup: Parse Error: ./node_modules/jexcel/node_modules/jsuites/dist/jsuites.css:15:0

Hy, i´m integrated jExcel in my StencilJS component, when i do a compìlation, the terminal return next error line:

[ ERROR ] Rollup: Parse Error: ./node_modules/jexcel/node_modules/jsuites/dist/jsuites.css:15:0 Unexpected token (Note that you need plugins to import files that are not JavaScript)

i added in my file stencil.config.ts the next code to try manage a roollups:

import { Config } from '@stencil/core';
import nodePolyfills from 'rollup-plugin-node-polyfills';
import { jsuites } from "jsuites";

export const config: Config = {
  namespace: 'excel-scib',
  rollupPlugins: {
    before: [
      nodePolyfills(),
    ],
    after: [
      // Plugins injected after commonjs()
      nodePolyfills()
    ]
  },
  taskQueue: 'async',
  commonjs:{
    namedExports: {
      'jsuites': ['jsuites']
    },
  },
  outputTargets: [
    {
      type: 'dist',
      esmLoaderPath: '../loader'
    },
    {
      type: 'docs-readme'
    },
    {
      type: 'www',
      serviceWorker: null // disable service workers
    }
  ]
};

but dont work, i dont have any ideas to continue wokring with this library.

Someone can help my plase?

Thank you.

Is the a way to reformat data when lazy loading autocomplete?

I would like to use the Dropdown with lazy loading, but my data source has another data format (a JSON, but with a more complex structure). How can load data via AJAX and add some preprocessing to transform it to key-value pairs? Maybe some sort of onLoad event? OnOpen would be fine too, but then there is no setData() method to populate the Dropdown...

bug in case numeric masking

in case of numeric, and some cell has the value '0'. the output is empty..
image

currentValue is 0, then don't enter to if, and also decimalValue is empty.

if u can solve it please,
Thanks Gal.

Using mask with 0

Hello, there is a UK Phone +44 0000 000 000 mask in there.
When we start typing it adds +44 auto, its cool. But i want to add +40 for example. When i start with "3" it must "+40 3", in this case it becomes "+43" how can i use 0 in phone format. Also how can i "a" in string masks. Thanks in advance.

Translate calendar's action buttons

Hello,

I have been using jExcel with jSuites at work to build a massive grid form. There is a column which contains a date so I used the calendar type, translated days and months but I looked into the source code and there doesn't appear to be a way to translate "Reset", "Done" and "Update".

Would it be possible to add options to translate these?

Thanks!

Prev arrow in calendar issue

Hello

When using the previous arrow in the calendar to navigate from Jan 2020, instead of Dec 2019, it goes to Jan 2019 and continues to go yearly instead of monthly.

Thanks

Add Definition to dropdown on hover (Feature Request)

Feature Request:
When hovering over a dropdown entity, have a "title" box that would display a "definition".

List entity:
{
"id":"apple",
"name":"Apple",
"definition":"An apple is an edible fruit produced by an apple tree (Malus domestica)."
}

dropdown groups fail on lazyload

Affects both 4.6.5 and 4.6.7
When items are grouped, lazyload fails with error
Uncaught TypeError: can't access property "appendChild", results[i].group.children[2] is undefined

From quick lookup, the block responsible for the error is the one below. With the line of error being this:
results[i].group.children[2].appendChild(results[i].element);

		for (var i = numberOfItems; i < numberOfItems + number; i++) {
			if (results[i].group) {
				if (! results[i].group.parentNode) {
					content.appendChild(results[i].group);
				}
				results[i].group.children[2].appendChild(results[i].element);
			} else {
				content.appendChild(results[i].element);
			}

			obj.numOfItems++;
		}

there is some small problem with remoteSearch

if (obj.options.remoteSearch == true) {

the url should correct from:
url: obj.options.url + '?q=' + str,
to:
url: obj.options.url + (obj.options.url.indexOf('?') > 0 ? "&" : "?") + 'q=' + str,

the Result Display Should Correct from :
obj.appendData(result);
to:
obj.setData(result);

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.