jsuites 4.14.4 → 4.15.1

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.
package/TODO.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # TODO list
2
2
 
3
3
  ## setDictinary
4
- ## Contextmenu mobile
4
+ ## Contextmenu mobile
5
+
6
+
7
+ https://codesandbox.io/s/javascript-image-cropper-forked-ipjiom?file=/src/App.js:356-359
@@ -17,7 +17,7 @@
17
17
 
18
18
  var jSuites = {};
19
19
 
20
- var Version = '4.14.4';
20
+ var Version = '4.15.1';
21
21
 
22
22
  var Events = function() {
23
23
 
@@ -455,7 +455,7 @@ jSuites.setDictionary = function(d) {
455
455
 
456
456
  // Translate
457
457
  jSuites.translate = function(t) {
458
- if (document.dictionary) {
458
+ if (typeof(document) !== "undefined" && document.dictionary) {
459
459
  return document.dictionary[t] || t;
460
460
  } else {
461
461
  return t;
@@ -2051,17 +2051,20 @@ jSuites.calendar.getDateString = function(value, options) {
2051
2051
  }
2052
2052
 
2053
2053
  // Convert to number of hours
2054
- if (typeof(value) == 'number' && format.indexOf('[h]') >= 0) {
2055
- var result = parseFloat(24 * Number(value));
2056
- if (format.indexOf('mm') >= 0) {
2057
- var h = (''+result).split('.');
2058
- if (h[1]) {
2059
- var d = 60 * parseFloat('0.' + h[1])
2060
- d = parseFloat(d.toFixed(2));
2061
- } else {
2062
- var d = 0;
2054
+ if (format.indexOf('[h]') >= 0) {
2055
+ var result = 0;
2056
+ if (value && jSuites.isNumeric(value)) {
2057
+ result = parseFloat(24 * Number(value));
2058
+ if (format.indexOf('mm') >= 0) {
2059
+ var h = (''+result).split('.');
2060
+ if (h[1]) {
2061
+ var d = 60 * parseFloat('0.' + h[1])
2062
+ d = parseFloat(d.toFixed(2));
2063
+ } else {
2064
+ var d = 0;
2065
+ }
2066
+ result = parseInt(h[0]) + ':' + jSuites.two(d);
2063
2067
  }
2064
- result = parseInt(h[0]) + ':' + jSuites.two(d);
2065
2068
  }
2066
2069
  return result;
2067
2070
  }
@@ -3539,7 +3542,7 @@ jSuites.dropdown = (function(el, options) {
3539
3542
 
3540
3543
  // Header
3541
3544
  obj.header = document.createElement('input');
3542
- obj.header.className = 'jdropdown-header';
3545
+ obj.header.className = 'jdropdown-header jss_object';
3543
3546
  obj.header.type = 'text';
3544
3547
  obj.header.setAttribute('autocomplete', 'off');
3545
3548
  obj.header.onfocus = function() {
@@ -7111,6 +7114,31 @@ jSuites.mask = (function() {
7111
7114
  return v;
7112
7115
  }
7113
7116
 
7117
+ var extractDate = function() {
7118
+ var v = '';
7119
+ if (! (this.date[0] && this.date[1] && this.date[2]) && (this.date[3] || this.date[4])) {
7120
+ if (this.mask.toLowerCase().indexOf('[h]') !== -1) {
7121
+ v = parseInt(this.date[3]);
7122
+ } else {
7123
+ v = parseInt(this.date[3]) % 24;
7124
+ }
7125
+ if (this.date[4]) {
7126
+ v += parseFloat(this.date[4] / 60);
7127
+ }
7128
+ v /= 24;
7129
+ } else if (this.date[0] || this.date[1] || this.date[2] || this.date[3] || this.date[4] || this.date[5]) {
7130
+ if (this.date[0] && this.date[1] && ! this.date[2]) {
7131
+ this.date[2] = 1;
7132
+ }
7133
+ var t = jSuites.calendar.now(this.date);
7134
+ v = jSuites.calendar.dateToNum(t);
7135
+ if (this.date[4]) {
7136
+ v += parseFloat(this.date[4] / 60);
7137
+ }
7138
+ }
7139
+ return v;
7140
+ }
7141
+
7114
7142
  var isBlank = function(v) {
7115
7143
  return v === null || v === '' || v === undefined ? true : false;
7116
7144
  }
@@ -8279,7 +8307,9 @@ jSuites.mask = (function() {
8279
8307
  var t = options.mask.split(';');
8280
8308
  options.mask = t[0];
8281
8309
  }
8310
+ options.mask = options.mask.replace(new RegExp(/\[h]/),'|h|');
8282
8311
  options.mask = options.mask.replace(new RegExp(/\[.*?\]/),'');
8312
+ options.mask = options.mask.replace(new RegExp(/\|h\|/),'[h]');
8283
8313
  }
8284
8314
 
8285
8315
  // Get decimal
@@ -8306,9 +8336,7 @@ jSuites.mask = (function() {
8306
8336
  if (jSuites.isNumeric(v)) {
8307
8337
  value = v;
8308
8338
  } else {
8309
- var value = getDate.call(o);
8310
- var t = jSuites.calendar.now(o.date);
8311
- value = jSuites.calendar.dateToNum(t);
8339
+ var value = extractDate.call(o);
8312
8340
  }
8313
8341
  } else {
8314
8342
  var value = Extract.call(options, v);
@@ -8383,7 +8411,6 @@ jSuites.mask = (function() {
8383
8411
  if (t) {
8384
8412
  value = t;
8385
8413
  }
8386
-
8387
8414
  if (options.mask && fullMask) {
8388
8415
  fillWithBlanks = true;
8389
8416
  }
package/dist/jsuites.css CHANGED
@@ -1705,23 +1705,31 @@ div[data-before]:before {
1705
1705
  background-color:#fff;
1706
1706
  transform: translate(-50%, -50%);
1707
1707
  box-sizing: border-box;
1708
- padding-top: 50px !important;
1709
1708
  z-index:9002;
1710
1709
  border-radius: 4px;
1711
1710
  }
1712
1711
 
1713
- .jmodal:before {
1714
- position: absolute;
1715
- top: 0;
1716
- left: 0;
1717
- width: 100%;
1718
- content:attr(title);
1712
+ .jmodal_title {
1719
1713
  padding: 25px;
1720
- padding-bottom: 20px;
1714
+ padding-bottom: 0px;
1721
1715
  box-sizing: border-box;
1722
1716
  font-size: 1.4em;
1723
1717
  background-color: #fff;
1724
1718
  border-radius: 8px 8px 0px 0px;
1719
+ pointer-events: none;
1720
+ display: flex;
1721
+ -webkit-align-items: center;
1722
+ -webkit-box-align: center;
1723
+ align-items: center;
1724
+ }
1725
+
1726
+ .jmodal_title[data-icon]:before {
1727
+ content: attr(data-icon);
1728
+ font-family: 'Material Icons' !important;
1729
+ width: 48px;
1730
+ height: 48px;
1731
+ font-size: 48px;
1732
+ padding-right: 10px;
1725
1733
  }
1726
1734
 
1727
1735
  .jmodal_content {
@@ -1729,12 +1737,19 @@ div[data-before]:before {
1729
1737
  overflow-y: auto;
1730
1738
  max-height: 100%;
1731
1739
  box-sizing: border-box;
1732
- height: -webkit-fill-available;
1733
-
1740
+ height: calc(100% - 55px);
1734
1741
  scrollbar-width: thin;
1735
1742
  scrollbar-color: #333 transparent;
1736
1743
  }
1737
1744
 
1745
+ .jmodal_title:empty {
1746
+ display: none;
1747
+ }
1748
+
1749
+ .jmodal_title:empty + .jmodal_content {
1750
+ height: -webkit-fill-available;
1751
+ }
1752
+
1738
1753
  .jmodal_content::-webkit-scrollbar {
1739
1754
  height: 12px;
1740
1755
  }
@@ -1753,15 +1768,6 @@ div[data-before]:before {
1753
1768
  background: #888;
1754
1769
  }
1755
1770
 
1756
-
1757
- .jmodal.no-title {
1758
- padding-top: initial !important;
1759
- }
1760
-
1761
- .jmodal.no-title:before {
1762
- display:none;
1763
- }
1764
-
1765
1771
  .jmodal:after {
1766
1772
  content: '';
1767
1773
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
package/dist/jsuites.js CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  var jSuites = {};
19
19
 
20
- var Version = '4.13.2';
20
+ var Version = '4.15.1';
21
21
 
22
22
  var Events = function() {
23
23
 
@@ -455,7 +455,7 @@ jSuites.setDictionary = function(d) {
455
455
 
456
456
  // Translate
457
457
  jSuites.translate = function(t) {
458
- if (document.dictionary) {
458
+ if (typeof(document) !== "undefined" && document.dictionary) {
459
459
  return document.dictionary[t] || t;
460
460
  } else {
461
461
  return t;
@@ -2062,17 +2062,20 @@ jSuites.calendar.getDateString = function(value, options) {
2062
2062
  }
2063
2063
 
2064
2064
  // Convert to number of hours
2065
- if (typeof(value) == 'number' && format.indexOf('[h]') >= 0) {
2066
- var result = parseFloat(24 * Number(value));
2067
- if (format.indexOf('mm') >= 0) {
2068
- var h = (''+result).split('.');
2069
- if (h[1]) {
2070
- var d = 60 * parseFloat('0.' + h[1])
2071
- d = parseFloat(d.toFixed(2));
2072
- } else {
2073
- var d = 0;
2065
+ if (format.indexOf('[h]') >= 0) {
2066
+ var result = 0;
2067
+ if (value && jSuites.isNumeric(value)) {
2068
+ result = parseFloat(24 * Number(value));
2069
+ if (format.indexOf('mm') >= 0) {
2070
+ var h = (''+result).split('.');
2071
+ if (h[1]) {
2072
+ var d = 60 * parseFloat('0.' + h[1])
2073
+ d = parseFloat(d.toFixed(2));
2074
+ } else {
2075
+ var d = 0;
2076
+ }
2077
+ result = parseInt(h[0]) + ':' + jSuites.two(d);
2074
2078
  }
2075
- result = parseInt(h[0]) + ':' + jSuites.two(d);
2076
2079
  }
2077
2080
  return result;
2078
2081
  }
@@ -3550,7 +3553,7 @@ jSuites.dropdown = (function(el, options) {
3550
3553
 
3551
3554
  // Header
3552
3555
  obj.header = document.createElement('input');
3553
- obj.header.className = 'jdropdown-header';
3556
+ obj.header.className = 'jdropdown-header jss_object';
3554
3557
  obj.header.type = 'text';
3555
3558
  obj.header.setAttribute('autocomplete', 'off');
3556
3559
  obj.header.onfocus = function() {
@@ -7536,6 +7539,31 @@ jSuites.mask = (function() {
7536
7539
  return v;
7537
7540
  }
7538
7541
 
7542
+ var extractDate = function() {
7543
+ var v = '';
7544
+ if (! (this.date[0] && this.date[1] && this.date[2]) && (this.date[3] || this.date[4])) {
7545
+ if (this.mask.toLowerCase().indexOf('[h]') !== -1) {
7546
+ v = parseInt(this.date[3]);
7547
+ } else {
7548
+ v = parseInt(this.date[3]) % 24;
7549
+ }
7550
+ if (this.date[4]) {
7551
+ v += parseFloat(this.date[4] / 60);
7552
+ }
7553
+ v /= 24;
7554
+ } else if (this.date[0] || this.date[1] || this.date[2] || this.date[3] || this.date[4] || this.date[5]) {
7555
+ if (this.date[0] && this.date[1] && ! this.date[2]) {
7556
+ this.date[2] = 1;
7557
+ }
7558
+ var t = jSuites.calendar.now(this.date);
7559
+ v = jSuites.calendar.dateToNum(t);
7560
+ if (this.date[4]) {
7561
+ v += parseFloat(this.date[4] / 60);
7562
+ }
7563
+ }
7564
+ return v;
7565
+ }
7566
+
7539
7567
  var isBlank = function(v) {
7540
7568
  return v === null || v === '' || v === undefined ? true : false;
7541
7569
  }
@@ -8704,7 +8732,9 @@ jSuites.mask = (function() {
8704
8732
  var t = options.mask.split(';');
8705
8733
  options.mask = t[0];
8706
8734
  }
8735
+ options.mask = options.mask.replace(new RegExp(/\[h]/),'|h|');
8707
8736
  options.mask = options.mask.replace(new RegExp(/\[.*?\]/),'');
8737
+ options.mask = options.mask.replace(new RegExp(/\|h\|/),'[h]');
8708
8738
  }
8709
8739
 
8710
8740
  // Get decimal
@@ -8731,9 +8761,7 @@ jSuites.mask = (function() {
8731
8761
  if (jSuites.isNumeric(v)) {
8732
8762
  value = v;
8733
8763
  } else {
8734
- var value = getDate.call(o);
8735
- var t = jSuites.calendar.now(o.date);
8736
- value = jSuites.calendar.dateToNum(t);
8764
+ var value = extractDate.call(o);
8737
8765
  }
8738
8766
  } else {
8739
8767
  var value = Extract.call(options, v);
@@ -8808,7 +8836,6 @@ jSuites.mask = (function() {
8808
8836
  if (t) {
8809
8837
  value = t;
8810
8838
  }
8811
-
8812
8839
  if (options.mask && fullMask) {
8813
8840
  fillWithBlanks = true;
8814
8841
  }
@@ -8939,6 +8966,7 @@ jSuites.modal = (function(el, options) {
8939
8966
  title: null,
8940
8967
  padding: null,
8941
8968
  backdrop: true,
8969
+ icon: null,
8942
8970
  };
8943
8971
 
8944
8972
  // Loop through our object
@@ -8960,6 +8988,12 @@ jSuites.modal = (function(el, options) {
8960
8988
  temp.appendChild(el.children[0]);
8961
8989
  }
8962
8990
 
8991
+ obj.title = document.createElement('div');
8992
+ obj.title.className = 'jmodal_title';
8993
+ if (obj.options.icon) {
8994
+ obj.title.setAttribute('data-icon', obj.options.icon);
8995
+ }
8996
+
8963
8997
  obj.content = document.createElement('div');
8964
8998
  obj.content.className = 'jmodal_content';
8965
8999
  obj.content.innerHTML = el.innerHTML;
@@ -8970,6 +9004,7 @@ jSuites.modal = (function(el, options) {
8970
9004
 
8971
9005
  obj.container = document.createElement('div');
8972
9006
  obj.container.className = 'jmodal';
9007
+ obj.container.appendChild(obj.title);
8973
9008
  obj.container.appendChild(obj.content);
8974
9009
 
8975
9010
  if (obj.options.padding) {
@@ -8982,10 +9017,9 @@ jSuites.modal = (function(el, options) {
8982
9017
  obj.container.style.height = obj.options.height;
8983
9018
  }
8984
9019
  if (obj.options.title) {
8985
- obj.container.setAttribute('title', obj.options.title);
8986
- } else {
8987
- obj.container.classList.add('no-title');
9020
+ obj.title.innerText = obj.options.title;
8988
9021
  }
9022
+
8989
9023
  el.innerHTML = '';
8990
9024
  el.style.display = 'none';
8991
9025
  el.appendChild(obj.container);
@@ -9100,7 +9134,7 @@ jSuites.modal = (function(el, options) {
9100
9134
  if (rect.width - (x - rect.left) < 50 && (y - rect.top) < 50) {
9101
9135
  // Do nothing
9102
9136
  } else {
9103
- if (e.target.getAttribute('title') && (y - rect.top) < 50) {
9137
+ if (y - rect.top < 50) {
9104
9138
  if (document.selection) {
9105
9139
  document.selection.empty();
9106
9140
  } else if ( window.getSelection ) {
@@ -3040,6 +3040,7 @@ jSuites.template = (function(el, options) {
3040
3040
  var searchContainer = document.createElement('div');
3041
3041
  searchContainer.className = 'jtemplate-results';
3042
3042
  obj.searchInput = document.createElement('input');
3043
+ obj.searchInput .className = 'jss_object';
3043
3044
  obj.searchInput.onkeyup = function(e) {
3044
3045
  // Clear current trigger
3045
3046
  if (searchTimer) {
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "javascript plugins"
20
20
  ],
21
21
  "main": "dist/jsuites.js",
22
- "version": "4.14.4",
22
+ "version": "4.15.1",
23
23
  "bugs": "https://github.com/jsuites/jsuites/issues",
24
24
  "homepage": "https://github.com/jsuites/jsuites",
25
25
  "docs": "https://jsuites.net",