jsuites 5.8.5 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/jsuites.js +360 -321
  2. package/package.json +1 -1
package/dist/jsuites.js CHANGED
@@ -4483,6 +4483,7 @@ function Palette() {
4483
4483
 
4484
4484
 
4485
4485
 
4486
+
4486
4487
  function Tabs(el, options) {
4487
4488
  var obj = {};
4488
4489
  obj.options = {};
@@ -4595,12 +4596,15 @@ function Tabs(el, options) {
4595
4596
  }
4596
4597
  // Remote selected
4597
4598
  obj.headers.children[i].classList.remove('jtabs-selected');
4599
+ obj.headers.children[i].removeAttribute('aria-selected')
4598
4600
  if (obj.content.children[i]) {
4599
4601
  obj.content.children[i].classList.remove('jtabs-selected');
4600
4602
  }
4601
4603
  }
4602
4604
 
4603
4605
  obj.headers.children[index].classList.add('jtabs-selected');
4606
+ obj.headers.children[index].setAttribute('aria-selected', 'true')
4607
+
4604
4608
  if (obj.content.children[index]) {
4605
4609
  obj.content.children[index].classList.add('jtabs-selected');
4606
4610
  }
@@ -4719,11 +4723,20 @@ function Tabs(el, options) {
4719
4723
  }
4720
4724
 
4721
4725
  if (title) {
4726
+ let headerId = helpers.guid();
4727
+ let contentId = helpers.guid();
4722
4728
  // Add content
4723
4729
  var div = document.createElement('div');
4730
+ div.setAttribute('id', contentId);
4731
+ div.setAttribute('role', 'tabpanel');
4732
+ div.setAttribute('aria-labelledby', headerId);
4724
4733
 
4725
4734
  // Add headers
4726
4735
  var h = document.createElement('div');
4736
+ h.setAttribute('id', headerId);
4737
+ h.setAttribute('role', 'tab');
4738
+ h.setAttribute('aria-controls', contentId);
4739
+
4727
4740
  h.innerHTML = title;
4728
4741
  h.content = div;
4729
4742
 
@@ -4832,7 +4845,10 @@ function Tabs(el, options) {
4832
4845
  obj.headers = document.createElement('div');
4833
4846
  obj.content = document.createElement('div');
4834
4847
  obj.headers.classList.add('jtabs-headers');
4848
+ obj.headers.setAttribute('role', 'tablist');
4835
4849
  obj.content.classList.add('jtabs-content');
4850
+ obj.content.setAttribute('role', 'region');
4851
+ obj.content.setAttribute('aria-label', 'Tab Panels');
4836
4852
 
4837
4853
  if (obj.options.palette) {
4838
4854
  el.classList.add('jtabs-modern');
@@ -5500,6 +5516,11 @@ function Color(el, options) {
5500
5516
  input.max = 255;
5501
5517
  input.value = 0;
5502
5518
 
5519
+ input.setAttribute('aria-label', "Color value");
5520
+ input.setAttribute('aria-valuemin', "0");
5521
+ input.setAttribute('aria-valuemax', "255");
5522
+ input.setAttribute('aria-valuenow', "0");
5523
+
5503
5524
  inputContainer.appendChild(label);
5504
5525
  subContainer.appendChild(input);
5505
5526
 
@@ -7788,325 +7809,334 @@ function Dropdown() {
7788
7809
 
7789
7810
  /* harmony default export */ var dropdown = (Dropdown());
7790
7811
  ;// CONCATENATED MODULE: ./src/plugins/picker.js
7791
-
7792
-
7793
-
7794
- function Picker(el, options) {
7795
- // Already created, update options
7796
- if (el.picker) {
7797
- return el.picker.setOptions(options, true);
7798
- }
7799
-
7800
- // New instance
7801
- var obj = { type: 'picker' };
7802
- obj.options = {};
7803
-
7804
- var dropdownHeader = null;
7805
- var dropdownContent = null;
7806
-
7807
- /**
7808
- * The element passed is a DOM element
7809
- */
7810
- var isDOM = function(o) {
7811
- return (o instanceof Element || o instanceof HTMLDocument);
7812
- }
7813
-
7814
- /**
7815
- * Create the content options
7816
- */
7817
- var createContent = function() {
7818
- dropdownContent.innerHTML = '';
7819
-
7820
- // Create items
7821
- var keys = Object.keys(obj.options.data);
7822
-
7823
- // Go though all options
7824
- for (var i = 0; i < keys.length; i++) {
7825
- // Item
7826
- var dropdownItem = document.createElement('div');
7827
- dropdownItem.classList.add('jpicker-item');
7828
- dropdownItem.k = keys[i];
7829
- dropdownItem.v = obj.options.data[keys[i]];
7830
- // Label
7831
- var item = obj.getLabel(keys[i], dropdownItem);
7832
- if (isDOM(item)) {
7833
- dropdownItem.appendChild(item);
7834
- } else {
7835
- dropdownItem.innerHTML = item;
7836
- }
7837
- // Append
7838
- dropdownContent.appendChild(dropdownItem);
7839
- }
7840
- }
7841
-
7842
- /**
7843
- * Set or reset the options for the picker
7844
- */
7845
- obj.setOptions = function(options, reset) {
7846
- // Default configuration
7847
- var defaults = {
7848
- value: 0,
7849
- data: null,
7850
- render: null,
7851
- onchange: null,
7852
- onmouseover: null,
7853
- onselect: null,
7854
- onopen: null,
7855
- onclose: null,
7856
- onload: null,
7857
- width: null,
7858
- header: true,
7859
- right: false,
7860
- bottom: false,
7861
- content: false,
7862
- columns: null,
7863
- grid: null,
7864
- height: null,
7865
- }
7866
-
7867
- // Legacy purpose only
7868
- if (options && options.options) {
7869
- options.data = options.options;
7870
- }
7871
-
7872
- // Loop through the initial configuration
7873
- for (var property in defaults) {
7874
- if (options && options.hasOwnProperty(property)) {
7875
- obj.options[property] = options[property];
7876
- } else {
7877
- if (typeof(obj.options[property]) == 'undefined' || reset === true) {
7878
- obj.options[property] = defaults[property];
7879
- }
7880
- }
7881
- }
7882
-
7883
- // Start using the options
7884
- if (obj.options.header === false) {
7885
- dropdownHeader.style.display = 'none';
7886
- } else {
7887
- dropdownHeader.style.display = '';
7888
- }
7889
-
7890
- // Width
7891
- if (obj.options.width) {
7892
- dropdownHeader.style.width = parseInt(obj.options.width) + 'px';
7893
- } else {
7894
- dropdownHeader.style.width = '';
7895
- }
7896
-
7897
- // Height
7898
- if (obj.options.height) {
7899
- dropdownContent.style.maxHeight = obj.options.height + 'px';
7900
- dropdownContent.style.overflow = 'scroll';
7901
- } else {
7902
- dropdownContent.style.overflow = '';
7903
- }
7904
-
7905
- if (obj.options.columns > 0) {
7906
- if (! obj.options.grid) {
7907
- dropdownContent.classList.add('jpicker-columns');
7908
- dropdownContent.style.width = obj.options.width ? obj.options.width : 36 * obj.options.columns + 'px';
7909
- } else {
7910
- dropdownContent.classList.add('jpicker-grid');
7911
- dropdownContent.style.gridTemplateColumns = 'repeat(' + obj.options.grid + ', 1fr)';
7912
- }
7913
- }
7914
-
7915
- if (isNaN(parseInt(obj.options.value))) {
7916
- obj.options.value = 0;
7917
- }
7918
-
7919
- // Create list from data
7920
- createContent();
7921
-
7922
- // Set value
7923
- obj.setValue(obj.options.value);
7924
-
7925
- // Set options all returns the own instance
7926
- return obj;
7927
- }
7928
-
7929
- obj.getValue = function() {
7930
- return obj.options.value;
7931
- }
7932
-
7933
- obj.setValue = function(k, e) {
7934
- // Set label
7935
- obj.setLabel(k);
7936
-
7937
- // Update value
7938
- obj.options.value = String(k);
7939
-
7940
- // Lemonade JS
7941
- if (el.value != obj.options.value) {
7942
- el.value = obj.options.value;
7943
- if (typeof(el.oninput) == 'function') {
7944
- el.oninput({
7945
- type: 'input',
7946
- target: el,
7947
- value: el.value
7948
- });
7949
- }
7950
- }
7951
-
7952
- if (dropdownContent.children[k] && dropdownContent.children[k].getAttribute('type') !== 'generic') {
7953
- obj.close();
7954
- }
7955
-
7956
- // Call method
7957
- if (e) {
7958
- if (typeof (obj.options.onchange) == 'function') {
7959
- var v = obj.options.data[k];
7960
-
7961
- obj.options.onchange(el, obj, v, v, k, e);
7962
- }
7963
- }
7964
- }
7965
-
7966
- obj.getLabel = function(v, item) {
7967
- var label = obj.options.data[v] || null;
7968
- if (typeof(obj.options.render) == 'function') {
7969
- label = obj.options.render(label, item);
7970
- }
7971
- return label;
7972
- }
7973
-
7974
- obj.setLabel = function(v) {
7975
- var item;
7976
-
7977
- if (obj.options.content) {
7978
- item = '<i class="material-icons">' + obj.options.content + '</i>';
7979
- } else {
7980
- item = obj.getLabel(v, null);
7981
- }
7982
- // Label
7983
- if (isDOM(item)) {
7984
- dropdownHeader.innerHTML = '';
7985
- dropdownHeader.appendChild(item);
7986
- } else {
7987
- dropdownHeader.innerHTML = item;
7988
- }
7989
- }
7990
-
7991
- obj.open = function() {
7992
- if (! el.classList.contains('jpicker-focus')) {
7993
- // Start tracking the element
7994
- tracking(obj, true);
7995
-
7996
- // Open picker
7997
- el.classList.add('jpicker-focus');
7998
- el.focus();
7999
-
8000
- var top = 0;
8001
- var left = 0;
8002
-
8003
- dropdownContent.style.marginLeft = '';
8004
-
8005
- var rectHeader = dropdownHeader.getBoundingClientRect();
8006
- var rectContent = dropdownContent.getBoundingClientRect();
8007
-
8008
- if (window.innerHeight < rectHeader.bottom + rectContent.height || obj.options.bottom) {
8009
- top = -1 * (rectContent.height + 4);
8010
- } else {
8011
- top = rectHeader.height + 4;
8012
- }
8013
-
8014
- if (obj.options.right === true) {
8015
- left = -1 * rectContent.width + rectHeader.width;
8016
- }
8017
-
8018
- if (rectContent.left + left < 0) {
8019
- left = left + rectContent.left + 10;
8020
- }
8021
- if (rectContent.left + rectContent.width > window.innerWidth) {
8022
- left = -1 * (10 + rectContent.left + rectContent.width - window.innerWidth);
8023
- }
8024
-
8025
- dropdownContent.style.marginTop = parseInt(top) + 'px';
8026
- dropdownContent.style.marginLeft = parseInt(left) + 'px';
8027
-
8028
- //dropdownContent.style.marginTop
8029
- if (typeof obj.options.onopen == 'function') {
8030
- obj.options.onopen(el, obj);
8031
- }
8032
- }
8033
- }
8034
-
8035
- obj.close = function() {
8036
- if (el.classList.contains('jpicker-focus')) {
8037
- el.classList.remove('jpicker-focus');
8038
-
8039
- // Start tracking the element
8040
- tracking(obj, false);
8041
-
8042
- if (typeof obj.options.onclose == 'function') {
8043
- obj.options.onclose(el, obj);
8044
- }
8045
- }
8046
- }
8047
-
8048
- /**
8049
- * Create floating picker
8050
- */
8051
- var init = function() {
8052
- // Class
8053
- el.classList.add('jpicker');
8054
- el.setAttribute('tabindex', '0');
8055
- el.onmousedown = function(e) {
8056
- if (! el.classList.contains('jpicker-focus')) {
8057
- obj.open();
8058
- }
8059
- }
8060
-
8061
- // Dropdown Header
8062
- dropdownHeader = document.createElement('div');
8063
- dropdownHeader.classList.add('jpicker-header');
8064
-
8065
- // Dropdown content
8066
- dropdownContent = document.createElement('div');
8067
- dropdownContent.classList.add('jpicker-content');
8068
- dropdownContent.onclick = function(e) {
8069
- var item = helpers.findElement(e.target, 'jpicker-item');
8070
- if (item) {
8071
- if (item.parentNode === dropdownContent) {
8072
- // Update label
8073
- obj.setValue(item.k, e);
8074
- }
8075
- }
8076
- }
8077
- // Append content and header
8078
- el.appendChild(dropdownHeader);
8079
- el.appendChild(dropdownContent);
8080
-
8081
- // Default value
8082
- el.value = options.value || 0;
8083
-
8084
- // Set options
8085
- obj.setOptions(options);
8086
-
8087
- if (typeof(obj.options.onload) == 'function') {
8088
- obj.options.onload(el, obj);
8089
- }
8090
-
8091
- // Change
8092
- el.change = obj.setValue;
8093
-
8094
- // Global generic value handler
8095
- el.val = function(val) {
8096
- if (val === undefined) {
8097
- return obj.getValue();
8098
- } else {
8099
- obj.setValue(val);
8100
- }
8101
- }
8102
-
8103
- // Reference
8104
- el.picker = obj;
8105
- }
8106
-
8107
- init();
8108
-
8109
- return obj;
7812
+
7813
+
7814
+
7815
+ function Picker(el, options) {
7816
+ // Already created, update options
7817
+ if (el.picker) {
7818
+ return el.picker.setOptions(options, true);
7819
+ }
7820
+
7821
+ // New instance
7822
+ var obj = { type: 'picker' };
7823
+ obj.options = {};
7824
+
7825
+ var dropdownHeader = null;
7826
+ var dropdownContent = null;
7827
+
7828
+ /**
7829
+ * The element passed is a DOM element
7830
+ */
7831
+ var isDOM = function(o) {
7832
+ return (o instanceof Element || o instanceof HTMLDocument);
7833
+ }
7834
+
7835
+ /**
7836
+ * Create the content options
7837
+ */
7838
+ var createContent = function() {
7839
+ dropdownContent.innerHTML = '';
7840
+
7841
+ // Create items
7842
+ var keys = Object.keys(obj.options.data);
7843
+
7844
+ // Go though all options
7845
+ for (var i = 0; i < keys.length; i++) {
7846
+ // Item
7847
+ var dropdownItem = document.createElement('div');
7848
+ dropdownItem.classList.add('jpicker-item');
7849
+ dropdownItem.setAttribute('role', 'option');
7850
+ dropdownItem.k = keys[i];
7851
+ dropdownItem.v = obj.options.data[keys[i]];
7852
+ // Label
7853
+ var item = obj.getLabel(keys[i], dropdownItem);
7854
+ if (isDOM(item)) {
7855
+ dropdownItem.appendChild(item);
7856
+ } else {
7857
+ dropdownItem.innerHTML = item;
7858
+ }
7859
+ // Append
7860
+ dropdownContent.appendChild(dropdownItem);
7861
+ }
7862
+ }
7863
+
7864
+ /**
7865
+ * Set or reset the options for the picker
7866
+ */
7867
+ obj.setOptions = function(options, reset) {
7868
+ // Default configuration
7869
+ var defaults = {
7870
+ value: 0,
7871
+ data: null,
7872
+ render: null,
7873
+ onchange: null,
7874
+ onmouseover: null,
7875
+ onselect: null,
7876
+ onopen: null,
7877
+ onclose: null,
7878
+ onload: null,
7879
+ width: null,
7880
+ header: true,
7881
+ right: false,
7882
+ bottom: false,
7883
+ content: false,
7884
+ columns: null,
7885
+ grid: null,
7886
+ height: null,
7887
+ }
7888
+
7889
+ // Legacy purpose only
7890
+ if (options && options.options) {
7891
+ options.data = options.options;
7892
+ }
7893
+
7894
+ // Loop through the initial configuration
7895
+ for (var property in defaults) {
7896
+ if (options && options.hasOwnProperty(property)) {
7897
+ obj.options[property] = options[property];
7898
+ } else {
7899
+ if (typeof(obj.options[property]) == 'undefined' || reset === true) {
7900
+ obj.options[property] = defaults[property];
7901
+ }
7902
+ }
7903
+ }
7904
+
7905
+ // Start using the options
7906
+ if (obj.options.header === false) {
7907
+ dropdownHeader.style.display = 'none';
7908
+ } else {
7909
+ dropdownHeader.style.display = '';
7910
+ }
7911
+
7912
+ // Width
7913
+ if (obj.options.width) {
7914
+ dropdownHeader.style.width = parseInt(obj.options.width) + 'px';
7915
+ } else {
7916
+ dropdownHeader.style.width = '';
7917
+ }
7918
+
7919
+ // Height
7920
+ if (obj.options.height) {
7921
+ dropdownContent.style.maxHeight = obj.options.height + 'px';
7922
+ dropdownContent.style.overflow = 'scroll';
7923
+ } else {
7924
+ dropdownContent.style.overflow = '';
7925
+ }
7926
+
7927
+ if (obj.options.columns > 0) {
7928
+ if (! obj.options.grid) {
7929
+ dropdownContent.classList.add('jpicker-columns');
7930
+ dropdownContent.style.width = obj.options.width ? obj.options.width : 36 * obj.options.columns + 'px';
7931
+ } else {
7932
+ dropdownContent.classList.add('jpicker-grid');
7933
+ dropdownContent.style.gridTemplateColumns = 'repeat(' + obj.options.grid + ', 1fr)';
7934
+ }
7935
+ }
7936
+
7937
+ if (isNaN(parseInt(obj.options.value))) {
7938
+ obj.options.value = 0;
7939
+ }
7940
+
7941
+ // Create list from data
7942
+ createContent();
7943
+
7944
+ // Set value
7945
+ obj.setValue(obj.options.value);
7946
+
7947
+ // Set options all returns the own instance
7948
+ return obj;
7949
+ }
7950
+
7951
+ obj.getValue = function() {
7952
+ return obj.options.value;
7953
+ }
7954
+
7955
+ obj.setValue = function(k, e) {
7956
+ // Set label
7957
+ obj.setLabel(k);
7958
+
7959
+ // Update value
7960
+ obj.options.value = String(k);
7961
+
7962
+ // Lemonade JS
7963
+ if (el.value != obj.options.value) {
7964
+ el.value = obj.options.value;
7965
+ if (typeof(el.oninput) == 'function') {
7966
+ el.oninput({
7967
+ type: 'input',
7968
+ target: el,
7969
+ value: el.value
7970
+ });
7971
+ }
7972
+ }
7973
+
7974
+ if (dropdownContent.children[k] && dropdownContent.children[k].getAttribute('type') !== 'generic') {
7975
+ obj.close();
7976
+ }
7977
+
7978
+ // Call method
7979
+ if (e) {
7980
+ if (typeof (obj.options.onchange) == 'function') {
7981
+ var v = obj.options.data[k];
7982
+
7983
+ obj.options.onchange(el, obj, v, v, k, e);
7984
+ }
7985
+ }
7986
+ }
7987
+
7988
+ obj.getLabel = function(v, item) {
7989
+ var label = obj.options.data[v] || null;
7990
+ if (typeof(obj.options.render) == 'function') {
7991
+ label = obj.options.render(label, item);
7992
+ }
7993
+ return label;
7994
+ }
7995
+
7996
+ obj.setLabel = function(v) {
7997
+ var item;
7998
+
7999
+ if (obj.options.content) {
8000
+ item = '<i class="material-icons">' + obj.options.content + '</i>';
8001
+ } else {
8002
+ item = obj.getLabel(v, null);
8003
+ }
8004
+ // Label
8005
+ if (isDOM(item)) {
8006
+ dropdownHeader.innerHTML = '';
8007
+ dropdownHeader.appendChild(item);
8008
+ } else {
8009
+ dropdownHeader.innerHTML = item;
8010
+ }
8011
+ }
8012
+
8013
+ obj.open = function() {
8014
+ if (! el.classList.contains('jpicker-focus')) {
8015
+ // Start tracking the element
8016
+ tracking(obj, true);
8017
+
8018
+ // Open picker
8019
+ el.classList.add('jpicker-focus');
8020
+ el.focus();
8021
+
8022
+ var top = 0;
8023
+ var left = 0;
8024
+
8025
+ dropdownContent.style.marginLeft = '';
8026
+
8027
+ var rectHeader = dropdownHeader.getBoundingClientRect();
8028
+ var rectContent = dropdownContent.getBoundingClientRect();
8029
+
8030
+ if (window.innerHeight < rectHeader.bottom + rectContent.height || obj.options.bottom) {
8031
+ top = -1 * (rectContent.height + 4);
8032
+ } else {
8033
+ top = rectHeader.height + 4;
8034
+ }
8035
+
8036
+ if (obj.options.right === true) {
8037
+ left = -1 * rectContent.width + rectHeader.width;
8038
+ }
8039
+
8040
+ if (rectContent.left + left < 0) {
8041
+ left = left + rectContent.left + 10;
8042
+ }
8043
+ if (rectContent.left + rectContent.width > window.innerWidth) {
8044
+ left = -1 * (10 + rectContent.left + rectContent.width - window.innerWidth);
8045
+ }
8046
+
8047
+ dropdownContent.style.marginTop = parseInt(top) + 'px';
8048
+ dropdownContent.style.marginLeft = parseInt(left) + 'px';
8049
+
8050
+ //dropdownContent.style.marginTop
8051
+ if (typeof obj.options.onopen == 'function') {
8052
+ obj.options.onopen(el, obj);
8053
+ }
8054
+ }
8055
+ }
8056
+
8057
+ obj.close = function() {
8058
+ if (el.classList.contains('jpicker-focus')) {
8059
+ el.classList.remove('jpicker-focus');
8060
+
8061
+ // Start tracking the element
8062
+ tracking(obj, false);
8063
+
8064
+ if (typeof obj.options.onclose == 'function') {
8065
+ obj.options.onclose(el, obj);
8066
+ }
8067
+ }
8068
+ }
8069
+
8070
+ /**
8071
+ * Create floating picker
8072
+ */
8073
+ var init = function() {
8074
+ let id = helpers.guid();
8075
+
8076
+ // Class
8077
+ el.classList.add('jpicker');
8078
+ el.setAttribute('role', 'combobox');
8079
+ el.setAttribute('aria-haspopup', 'listbox');
8080
+ el.setAttribute('aria-expanded', 'false');
8081
+ el.setAttribute('aria-controls', id);
8082
+ el.setAttribute('tabindex', '0');
8083
+ el.onmousedown = function(e) {
8084
+ if (! el.classList.contains('jpicker-focus')) {
8085
+ obj.open();
8086
+ }
8087
+ }
8088
+
8089
+ // Dropdown Header
8090
+ dropdownHeader = document.createElement('div');
8091
+ dropdownHeader.classList.add('jpicker-header');
8092
+
8093
+ // Dropdown content
8094
+ dropdownContent = document.createElement('div');
8095
+ dropdownContent.setAttribute('id', id);
8096
+ dropdownContent.setAttribute('role', 'listbox');
8097
+ dropdownContent.classList.add('jpicker-content');
8098
+ dropdownContent.onclick = function(e) {
8099
+ var item = helpers.findElement(e.target, 'jpicker-item');
8100
+ if (item) {
8101
+ if (item.parentNode === dropdownContent) {
8102
+ // Update label
8103
+ obj.setValue(item.k, e);
8104
+ }
8105
+ }
8106
+ }
8107
+ // Append content and header
8108
+ el.appendChild(dropdownHeader);
8109
+ el.appendChild(dropdownContent);
8110
+
8111
+ // Default value
8112
+ el.value = options.value || 0;
8113
+
8114
+ // Set options
8115
+ obj.setOptions(options);
8116
+
8117
+ if (typeof(obj.options.onload) == 'function') {
8118
+ obj.options.onload(el, obj);
8119
+ }
8120
+
8121
+ // Change
8122
+ el.change = obj.setValue;
8123
+
8124
+ // Global generic value handler
8125
+ el.val = function(val) {
8126
+ if (val === undefined) {
8127
+ return obj.getValue();
8128
+ } else {
8129
+ obj.setValue(val);
8130
+ }
8131
+ }
8132
+
8133
+ // Reference
8134
+ el.picker = obj;
8135
+ }
8136
+
8137
+ init();
8138
+
8139
+ return obj;
8110
8140
  }
8111
8141
  ;// CONCATENATED MODULE: ./src/plugins/toolbar.js
8112
8142
 
@@ -8225,6 +8255,7 @@ function Toolbar(el, options) {
8225
8255
 
8226
8256
  if (items[i].tooltip) {
8227
8257
  toolbarItem.setAttribute('title', items[i].tooltip);
8258
+ toolbarItem.setAttribute('aria-label', items[i].tooltip);
8228
8259
  }
8229
8260
 
8230
8261
  // Id
@@ -8264,6 +8295,7 @@ function Toolbar(el, options) {
8264
8295
  }
8265
8296
  }
8266
8297
  toolbarIcon.innerHTML = items[i].content ? items[i].content : '';
8298
+ toolbarItem.setAttribute('role', 'button');
8267
8299
  toolbarItem.appendChild(toolbarIcon);
8268
8300
 
8269
8301
  // Badge options
@@ -10185,9 +10217,16 @@ function Validations() {
10185
10217
  }
10186
10218
 
10187
10219
  component.textLength = function(data, options) {
10188
- data = data.toString();
10220
+ let textLength;
10221
+ if (typeof data === 'string') {
10222
+ textLength = data.length;
10223
+ } else if (typeof data !== 'undefined' && data !== null && typeof data.toString === 'function') {
10224
+ textLength = data.toString().length;
10225
+ } else {
10226
+ textLength = 0;
10227
+ }
10189
10228
 
10190
- return component.number(data.length, options);
10229
+ return component.number(textLength, options);
10191
10230
  }
10192
10231
 
10193
10232
  return component;
package/package.json CHANGED
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "main": "dist/jsuites.js",
28
28
  "types": "dist/jsuites.d.ts",
29
- "version": "5.8.5",
29
+ "version": "5.9.0",
30
30
  "bugs": "https://github.com/jsuites/jsuites/issues",
31
31
  "homepage": "https://github.com/jsuites/jsuites",
32
32
  "docs": "https://jsuites.net",