jsuites 4.11.6 → 4.12.3

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.
@@ -143,7 +143,37 @@ div[data-before]:before {
143
143
  border-radius: 1000px;
144
144
  }
145
145
 
146
+ .jtooltip {
147
+ position: fixed;
148
+ top: 10px;
149
+ left: 10px;
150
+ z-index: 5;
146
151
 
152
+ font-family: initial;
153
+ font-size: 12px;
154
+ color: #000;
155
+ background-color: #fff;
156
+ border: 1px solid black;
157
+ padding: 8px;
158
+ margin: 10px;
159
+
160
+ display: block;
161
+ animation: fadeIn 0.5s;
162
+ pointer-events: none;
163
+ }
164
+
165
+ .jtooltip:empty {
166
+ display: none;
167
+ }
168
+
169
+ @keyframes fadeIn {
170
+ 0% {
171
+ opacity: 0;
172
+ }
173
+ 100% {
174
+ opacity: 1;
175
+ }
176
+ }
147
177
 
148
178
  /** Animations **/
149
179
  .fade-in {
@@ -825,22 +855,15 @@ div[data-before]:before {
825
855
  .jcontextmenu > div::before {
826
856
  content: attr(data-icon);
827
857
  font-family: 'Material Icons' !important;
828
- font-weight: normal;
829
- font-style: normal;
830
- font-size: 16px;
831
- line-height: 1;
832
- letter-spacing: normal;
833
- text-transform: none;
834
- display: inline-block;
835
- white-space: nowrap;
836
- word-wrap: normal;
837
- direction: ltr;
838
- -webkit-font-feature-settings: 'liga';
839
- -webkit-font-smoothing: antialiased;
858
+ font-size: 15px;
840
859
  position: absolute;
841
860
  left: 9px;
842
861
  }
843
862
 
863
+ .jcontextmenu.symbols > div::before {
864
+ font-family: 'Material Symbols Outlined' !important;
865
+ }
866
+
844
867
  .jcontextmenu > div.header {
845
868
  display: none;
846
869
  }
@@ -920,25 +943,6 @@ div[data-before]:before {
920
943
  .jcontextmenu > div.header > a.close {
921
944
  text-align: right;
922
945
  }
923
-
924
- .jcontextmenu > div::before {
925
- content: attr(data-icon);
926
- font-family: 'Material Icons' !important;
927
- font-weight: normal;
928
- font-style: normal;
929
- font-size: 16px;
930
- line-height: 1;
931
- letter-spacing: normal;
932
- text-transform: none;
933
- display: inline-block;
934
- white-space: nowrap;
935
- word-wrap: normal;
936
- direction: ltr;
937
- -webkit-font-feature-settings: 'liga';
938
- -webkit-font-smoothing: antialiased;
939
- position: absolute;
940
- left: 9px;
941
- }
942
946
  .jcontextmenu a {
943
947
  font-size: 1.4em;
944
948
  text-transform: uppercase;
@@ -17,7 +17,7 @@
17
17
 
18
18
  var jSuites = function(options) {
19
19
  var obj = {}
20
- var version = '4.11.6';
20
+ var version = '4.12.3';
21
21
 
22
22
  var find = function(DOMElement, component) {
23
23
  if (DOMElement[component.type] && DOMElement[component.type] == component) {
@@ -55,8 +55,12 @@ var jSuites = function(options) {
55
55
  y: null,
56
56
  }
57
57
 
58
+ // Tooltip element
59
+ var tooltip = document.createElement('div')
60
+ tooltip.classList.add('jtooltip');
61
+
58
62
  // Events
59
- var editorMouseDown = function(e) {
63
+ var mouseDown = function(e) {
60
64
  // Check if this is the floating
61
65
  var item = jSuites.findElement(e.target, 'jpanel');
62
66
  // Jfloating found
@@ -73,6 +77,7 @@ var jSuites = function(options) {
73
77
  h: rect.height,
74
78
  d: item.style.cursor,
75
79
  resizing: item.style.cursor ? true : false,
80
+ actioned: false,
76
81
  }
77
82
 
78
83
  // Make sure width and height styling is OK
@@ -128,9 +133,9 @@ var jSuites = function(options) {
128
133
  isOpened(element);
129
134
  }
130
135
 
131
- var editorMouseUp = function(e) {
136
+ var mouseUp = function(e) {
132
137
  if (editorAction && editorAction.e) {
133
- if (typeof(editorAction.e.refresh) == 'function') {
138
+ if (typeof(editorAction.e.refresh) == 'function' && state.actioned) {
134
139
  editorAction.e.refresh();
135
140
  }
136
141
  editorAction.e.style.cursor = '';
@@ -145,7 +150,7 @@ var jSuites = function(options) {
145
150
  editorAction = false;
146
151
  }
147
152
 
148
- var editorMouseMove = function(e) {
153
+ var mouseMove = function(e) {
149
154
  if (editorAction) {
150
155
  var x = e.clientX || e.pageX;
151
156
  var y = e.clientY || e.pageY;
@@ -173,6 +178,7 @@ var jSuites = function(options) {
173
178
 
174
179
  // Update element
175
180
  if (typeof(editorAction.e.refresh) == 'function') {
181
+ state.actioned = true;
176
182
  editorAction.e.refresh('position', top, left);
177
183
  }
178
184
  } else {
@@ -203,6 +209,7 @@ var jSuites = function(options) {
203
209
 
204
210
  // Update element
205
211
  if (typeof(editorAction.e.refresh) == 'function') {
212
+ state.actioned = true;
206
213
  editorAction.e.refresh('dimensions', width, height);
207
214
  }
208
215
  }
@@ -241,7 +248,31 @@ var jSuites = function(options) {
241
248
  }
242
249
  }
243
250
 
244
- var editorDblClick = function(e) {
251
+ var mouseOver = function(e) {
252
+ var message = e.target.getAttribute('data-tooltip');
253
+ if (message) {
254
+ // Instructions
255
+ tooltip.innerText = message;
256
+
257
+ // Position
258
+ if (e.changedTouches && e.changedTouches[0]) {
259
+ var x = e.changedTouches[0].clientX;
260
+ var y = e.changedTouches[0].clientY;
261
+ } else {
262
+ var x = e.clientX;
263
+ var y = e.clientY;
264
+ }
265
+
266
+ tooltip.style.top = y + 'px';
267
+ tooltip.style.left = x + 'px';
268
+ document.body.appendChild(tooltip);
269
+ } else if (tooltip.innerText) {
270
+ tooltip.innerText = '';
271
+ document.body.removeChild(tooltip);
272
+ }
273
+ }
274
+
275
+ var dblClick = function(e) {
245
276
  var item = jSuites.findElement(e.target, 'jpanel');
246
277
  if (item && typeof(item.dblclick) == 'function') {
247
278
  // Create edition
@@ -249,7 +280,7 @@ var jSuites = function(options) {
249
280
  }
250
281
  }
251
282
 
252
- var editorContextmenu = function(e) {
283
+ var contextMenu = function(e) {
253
284
  var item = document.activeElement;
254
285
  if (item && typeof(item.contextmenu) == 'function') {
255
286
  // Create edition
@@ -276,7 +307,7 @@ var jSuites = function(options) {
276
307
  }
277
308
  }
278
309
 
279
- var editorKeyDown = function(e) {
310
+ var keyDown = function(e) {
280
311
  var item = document.activeElement;
281
312
  if (item) {
282
313
  if (e.key == "Delete" && typeof(item.delete) == 'function') {
@@ -297,12 +328,13 @@ var jSuites = function(options) {
297
328
  }
298
329
  }
299
330
 
300
- document.addEventListener('mouseup', editorMouseUp);
301
- document.addEventListener("mousedown", editorMouseDown);
302
- document.addEventListener('mousemove', editorMouseMove);
303
- document.addEventListener('dblclick', editorDblClick);
304
- document.addEventListener('keydown', editorKeyDown);
305
- document.addEventListener('contextmenu', editorContextmenu);
331
+ document.addEventListener('mouseup', mouseUp);
332
+ document.addEventListener("mousedown", mouseDown);
333
+ document.addEventListener('mousemove', mouseMove);
334
+ document.addEventListener('mouseover', mouseOver);
335
+ document.addEventListener('dblclick', dblClick);
336
+ document.addEventListener('keydown', keyDown);
337
+ document.addEventListener('contextmenu', contextMenu);
306
338
  document.dictionary = {};
307
339
 
308
340
  obj.version = version;
@@ -1882,6 +1914,7 @@ jSuites.calendar.prettifyAll = function() {
1882
1914
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].getAttribute('data-date'));
1883
1915
  } else {
1884
1916
  if (elements[i].innerHTML) {
1917
+ elements[i].setAttribute('title', elements[i].innerHTML);
1885
1918
  elements[i].setAttribute('data-date', elements[i].innerHTML);
1886
1919
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].innerHTML);
1887
1920
  }
@@ -2305,7 +2338,7 @@ jSuites.color = (function(el, options) {
2305
2338
  }
2306
2339
 
2307
2340
  obj.select = function(color) {
2308
- // Remove current selecded mark
2341
+ // Remove current selected mark
2309
2342
  var selected = container.querySelector('.jcolor-selected');
2310
2343
  if (selected) {
2311
2344
  selected.classList.remove('jcolor-selected');
@@ -2315,6 +2348,8 @@ jSuites.color = (function(el, options) {
2315
2348
  if (obj.values[color]) {
2316
2349
  obj.values[color].classList.add('jcolor-selected');
2317
2350
  }
2351
+
2352
+ obj.options.value = color;
2318
2353
  }
2319
2354
 
2320
2355
  /**
@@ -2936,8 +2971,13 @@ jSuites.contextmenu = (function(el, options) {
2936
2971
  // Coordinates
2937
2972
  if ((obj.options.items && obj.options.items.length > 0) || el.children.length) {
2938
2973
  if (e.target) {
2939
- var x = e.clientX;
2940
- var y = e.clientY;
2974
+ if (e.changedTouches && e.changedTouches[0]) {
2975
+ x = e.changedTouches[0].clientX;
2976
+ y = e.changedTouches[0].clientY;
2977
+ } else {
2978
+ var x = e.clientX;
2979
+ var y = e.clientY;
2980
+ }
2941
2981
  } else {
2942
2982
  var x = e.x;
2943
2983
  var y = e.y;
@@ -2967,6 +3007,10 @@ jSuites.contextmenu = (function(el, options) {
2967
3007
  }
2968
3008
  }
2969
3009
 
3010
+ obj.isOpened = function() {
3011
+ return el.classList.contains('jcontextmenu-focus') ? true : false;
3012
+ }
3013
+
2970
3014
  /**
2971
3015
  * Close menu
2972
3016
  */
@@ -8021,14 +8065,12 @@ jSuites.mask = (function() {
8021
8065
  if (o.mask.indexOf('##') !== -1) {
8022
8066
  var d = o.mask.split(';');
8023
8067
  if (d[0]) {
8024
- d[0] = d[0].replace('*', '');
8025
- d[0] = d[0].replace(/_/g, '');
8026
- d[0] = d[0].replace(/-/g, '');
8027
- d[0] = d[0].replace('(','');
8028
- d[0] = d[0].replace(')','');
8068
+ d[0] = d[0].replace('*', '\t');
8069
+ d[0] = d[0].replace(new RegExp(/_-/g), ' ');
8029
8070
  d[0] = d[0].replace('##0.###','##0.000');
8030
8071
  d[0] = d[0].replace('##0.##','##0.00');
8031
8072
  d[0] = d[0].replace('##0.#','##0.0');
8073
+ d[0] = d[0].replace(new RegExp(/\[.*?\]/),'');
8032
8074
  }
8033
8075
  o.mask = d[0];
8034
8076
  }
package/dist/jsuites.css CHANGED
@@ -143,7 +143,37 @@ div[data-before]:before {
143
143
  border-radius: 1000px;
144
144
  }
145
145
 
146
+ .jtooltip {
147
+ position: fixed;
148
+ top: 10px;
149
+ left: 10px;
150
+ z-index: 5;
146
151
 
152
+ font-family: initial;
153
+ font-size: 12px;
154
+ color: #000;
155
+ background-color: #fff;
156
+ border: 1px solid black;
157
+ padding: 8px;
158
+ margin: 10px;
159
+
160
+ display: block;
161
+ animation: fadeIn 0.5s;
162
+ pointer-events: none;
163
+ }
164
+
165
+ .jtooltip:empty {
166
+ display: none;
167
+ }
168
+
169
+ @keyframes fadeIn {
170
+ 0% {
171
+ opacity: 0;
172
+ }
173
+ 100% {
174
+ opacity: 1;
175
+ }
176
+ }
147
177
 
148
178
  /** Animations **/
149
179
  .fade-in {
@@ -825,22 +855,15 @@ div[data-before]:before {
825
855
  .jcontextmenu > div::before {
826
856
  content: attr(data-icon);
827
857
  font-family: 'Material Icons' !important;
828
- font-weight: normal;
829
- font-style: normal;
830
- font-size: 16px;
831
- line-height: 1;
832
- letter-spacing: normal;
833
- text-transform: none;
834
- display: inline-block;
835
- white-space: nowrap;
836
- word-wrap: normal;
837
- direction: ltr;
838
- -webkit-font-feature-settings: 'liga';
839
- -webkit-font-smoothing: antialiased;
858
+ font-size: 15px;
840
859
  position: absolute;
841
860
  left: 9px;
842
861
  }
843
862
 
863
+ .jcontextmenu.symbols > div::before {
864
+ font-family: 'Material Symbols Outlined' !important;
865
+ }
866
+
844
867
  .jcontextmenu > div.header {
845
868
  display: none;
846
869
  }
@@ -920,25 +943,6 @@ div[data-before]:before {
920
943
  .jcontextmenu > div.header > a.close {
921
944
  text-align: right;
922
945
  }
923
-
924
- .jcontextmenu > div::before {
925
- content: attr(data-icon);
926
- font-family: 'Material Icons' !important;
927
- font-weight: normal;
928
- font-style: normal;
929
- font-size: 16px;
930
- line-height: 1;
931
- letter-spacing: normal;
932
- text-transform: none;
933
- display: inline-block;
934
- white-space: nowrap;
935
- word-wrap: normal;
936
- direction: ltr;
937
- -webkit-font-feature-settings: 'liga';
938
- -webkit-font-smoothing: antialiased;
939
- position: absolute;
940
- left: 9px;
941
- }
942
946
  .jcontextmenu a {
943
947
  font-size: 1.4em;
944
948
  text-transform: uppercase;
@@ -1689,38 +1693,61 @@ div[data-before]:before {
1689
1693
  left:50%;
1690
1694
  width:60%;
1691
1695
  height:60%;
1692
- -webkit-box-shadow: 0 2px 10px rgba(0,0,0,.2);
1693
- -moz-box-shadow: 0 2px 10px rgba(0,0,0,.2);
1696
+ -webkit-box-shadow: 0 2px 12px rgba(0,0,0,.2);
1697
+ -moz-box-shadow: 0 2px 12px rgba(0,0,0,.2);
1694
1698
  border:1px solid #ccc;
1695
1699
  background-color:#fff;
1696
1700
  transform: translate(-50%, -50%);
1697
1701
  box-sizing: border-box;
1698
- padding-top:50px !important;
1702
+ padding-top: 50px !important;
1699
1703
  z-index:9002;
1700
- border-radius: 8px;
1704
+ border-radius: 4px;
1701
1705
  }
1702
1706
 
1703
1707
  .jmodal:before {
1704
- position:absolute;
1705
- top:0;
1706
- left:0;
1707
- width:100%;
1708
+ position: absolute;
1709
+ top: 0;
1710
+ left: 0;
1711
+ width: 100%;
1708
1712
  content:attr(title);
1709
- padding:15px;
1713
+ padding: 25px;
1714
+ padding-bottom: 20px;
1710
1715
  box-sizing: border-box;
1711
- font-size:1.2em;
1712
- box-shadow: 1px 1px 3px rgba(0,0,0,.2);
1716
+ font-size: 1.4em;
1713
1717
  background-color: #fff;
1714
1718
  border-radius: 8px 8px 0px 0px;
1715
1719
  }
1716
1720
 
1717
1721
  .jmodal_content {
1718
- padding:20px;
1719
- overflow-y:auto;
1720
- max-height:100%;
1722
+ padding: 22px;
1723
+ overflow-y: auto;
1724
+ max-height: 100%;
1721
1725
  box-sizing: border-box;
1722
1726
  height: -webkit-fill-available;
1727
+
1728
+ scrollbar-width: thin;
1729
+ scrollbar-color: #333 transparent;
1730
+ }
1731
+
1732
+ .jmodal_content::-webkit-scrollbar {
1733
+ height: 12px;
1734
+ }
1735
+
1736
+ .jmodal_content::-webkit-scrollbar {
1737
+ width: 12px;
1738
+ }
1739
+
1740
+ .jmodal_content::-webkit-scrollbar-track {
1741
+ border: 1px solid #fff;
1742
+ background: #eee;
1743
+ }
1744
+
1745
+ .jmodal_content::-webkit-scrollbar-thumb {
1746
+ border: 1px solid #fff;
1747
+ background: #888;
1723
1748
  }
1749
+
1750
+
1724
1751
  .jmodal.no-title {
1725
1752
  padding-top: initial !important;
1726
1753
  }
@@ -1730,16 +1757,16 @@ div[data-before]:before {
1730
1757
  }
1731
1758
 
1732
1759
  .jmodal:after {
1733
- content:'';
1760
+ content: '';
1734
1761
  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");
1735
- position:absolute;
1736
- top:0;
1737
- right:0;
1738
- margin:14px;
1739
- font-size:24px;
1740
- width:24px;
1741
- height:24px;
1742
- cursor:pointer;
1762
+ position: absolute;
1763
+ top: 0;
1764
+ right: 0;
1765
+ margin: 25px;
1766
+ font-size: 24px;
1767
+ width: 24px;
1768
+ height: 24px;
1769
+ cursor: pointer;
1743
1770
  text-shadow: 0px 0px 5px #fff;
1744
1771
  }
1745
1772
 
package/dist/jsuites.js CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  var jSuites = function(options) {
19
19
  var obj = {}
20
- var version = '4.11.6';
20
+ var version = '4.12.3';
21
21
 
22
22
  var find = function(DOMElement, component) {
23
23
  if (DOMElement[component.type] && DOMElement[component.type] == component) {
@@ -55,8 +55,12 @@ var jSuites = function(options) {
55
55
  y: null,
56
56
  }
57
57
 
58
+ // Tooltip element
59
+ var tooltip = document.createElement('div')
60
+ tooltip.classList.add('jtooltip');
61
+
58
62
  // Events
59
- var editorMouseDown = function(e) {
63
+ var mouseDown = function(e) {
60
64
  // Check if this is the floating
61
65
  var item = jSuites.findElement(e.target, 'jpanel');
62
66
  // Jfloating found
@@ -73,6 +77,7 @@ var jSuites = function(options) {
73
77
  h: rect.height,
74
78
  d: item.style.cursor,
75
79
  resizing: item.style.cursor ? true : false,
80
+ actioned: false,
76
81
  }
77
82
 
78
83
  // Make sure width and height styling is OK
@@ -128,9 +133,9 @@ var jSuites = function(options) {
128
133
  isOpened(element);
129
134
  }
130
135
 
131
- var editorMouseUp = function(e) {
136
+ var mouseUp = function(e) {
132
137
  if (editorAction && editorAction.e) {
133
- if (typeof(editorAction.e.refresh) == 'function') {
138
+ if (typeof(editorAction.e.refresh) == 'function' && state.actioned) {
134
139
  editorAction.e.refresh();
135
140
  }
136
141
  editorAction.e.style.cursor = '';
@@ -145,7 +150,7 @@ var jSuites = function(options) {
145
150
  editorAction = false;
146
151
  }
147
152
 
148
- var editorMouseMove = function(e) {
153
+ var mouseMove = function(e) {
149
154
  if (editorAction) {
150
155
  var x = e.clientX || e.pageX;
151
156
  var y = e.clientY || e.pageY;
@@ -173,6 +178,7 @@ var jSuites = function(options) {
173
178
 
174
179
  // Update element
175
180
  if (typeof(editorAction.e.refresh) == 'function') {
181
+ state.actioned = true;
176
182
  editorAction.e.refresh('position', top, left);
177
183
  }
178
184
  } else {
@@ -203,6 +209,7 @@ var jSuites = function(options) {
203
209
 
204
210
  // Update element
205
211
  if (typeof(editorAction.e.refresh) == 'function') {
212
+ state.actioned = true;
206
213
  editorAction.e.refresh('dimensions', width, height);
207
214
  }
208
215
  }
@@ -241,7 +248,31 @@ var jSuites = function(options) {
241
248
  }
242
249
  }
243
250
 
244
- var editorDblClick = function(e) {
251
+ var mouseOver = function(e) {
252
+ var message = e.target.getAttribute('data-tooltip');
253
+ if (message) {
254
+ // Instructions
255
+ tooltip.innerText = message;
256
+
257
+ // Position
258
+ if (e.changedTouches && e.changedTouches[0]) {
259
+ var x = e.changedTouches[0].clientX;
260
+ var y = e.changedTouches[0].clientY;
261
+ } else {
262
+ var x = e.clientX;
263
+ var y = e.clientY;
264
+ }
265
+
266
+ tooltip.style.top = y + 'px';
267
+ tooltip.style.left = x + 'px';
268
+ document.body.appendChild(tooltip);
269
+ } else if (tooltip.innerText) {
270
+ tooltip.innerText = '';
271
+ document.body.removeChild(tooltip);
272
+ }
273
+ }
274
+
275
+ var dblClick = function(e) {
245
276
  var item = jSuites.findElement(e.target, 'jpanel');
246
277
  if (item && typeof(item.dblclick) == 'function') {
247
278
  // Create edition
@@ -249,7 +280,7 @@ var jSuites = function(options) {
249
280
  }
250
281
  }
251
282
 
252
- var editorContextmenu = function(e) {
283
+ var contextMenu = function(e) {
253
284
  var item = document.activeElement;
254
285
  if (item && typeof(item.contextmenu) == 'function') {
255
286
  // Create edition
@@ -276,7 +307,7 @@ var jSuites = function(options) {
276
307
  }
277
308
  }
278
309
 
279
- var editorKeyDown = function(e) {
310
+ var keyDown = function(e) {
280
311
  var item = document.activeElement;
281
312
  if (item) {
282
313
  if (e.key == "Delete" && typeof(item.delete) == 'function') {
@@ -297,12 +328,13 @@ var jSuites = function(options) {
297
328
  }
298
329
  }
299
330
 
300
- document.addEventListener('mouseup', editorMouseUp);
301
- document.addEventListener("mousedown", editorMouseDown);
302
- document.addEventListener('mousemove', editorMouseMove);
303
- document.addEventListener('dblclick', editorDblClick);
304
- document.addEventListener('keydown', editorKeyDown);
305
- document.addEventListener('contextmenu', editorContextmenu);
331
+ document.addEventListener('mouseup', mouseUp);
332
+ document.addEventListener("mousedown", mouseDown);
333
+ document.addEventListener('mousemove', mouseMove);
334
+ document.addEventListener('mouseover', mouseOver);
335
+ document.addEventListener('dblclick', dblClick);
336
+ document.addEventListener('keydown', keyDown);
337
+ document.addEventListener('contextmenu', contextMenu);
306
338
  document.dictionary = {};
307
339
 
308
340
  obj.version = version;
@@ -1893,6 +1925,7 @@ jSuites.calendar.prettifyAll = function() {
1893
1925
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].getAttribute('data-date'));
1894
1926
  } else {
1895
1927
  if (elements[i].innerHTML) {
1928
+ elements[i].setAttribute('title', elements[i].innerHTML);
1896
1929
  elements[i].setAttribute('data-date', elements[i].innerHTML);
1897
1930
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].innerHTML);
1898
1931
  }
@@ -2316,7 +2349,7 @@ jSuites.color = (function(el, options) {
2316
2349
  }
2317
2350
 
2318
2351
  obj.select = function(color) {
2319
- // Remove current selecded mark
2352
+ // Remove current selected mark
2320
2353
  var selected = container.querySelector('.jcolor-selected');
2321
2354
  if (selected) {
2322
2355
  selected.classList.remove('jcolor-selected');
@@ -2326,6 +2359,8 @@ jSuites.color = (function(el, options) {
2326
2359
  if (obj.values[color]) {
2327
2360
  obj.values[color].classList.add('jcolor-selected');
2328
2361
  }
2362
+
2363
+ obj.options.value = color;
2329
2364
  }
2330
2365
 
2331
2366
  /**
@@ -2947,8 +2982,13 @@ jSuites.contextmenu = (function(el, options) {
2947
2982
  // Coordinates
2948
2983
  if ((obj.options.items && obj.options.items.length > 0) || el.children.length) {
2949
2984
  if (e.target) {
2950
- var x = e.clientX;
2951
- var y = e.clientY;
2985
+ if (e.changedTouches && e.changedTouches[0]) {
2986
+ x = e.changedTouches[0].clientX;
2987
+ y = e.changedTouches[0].clientY;
2988
+ } else {
2989
+ var x = e.clientX;
2990
+ var y = e.clientY;
2991
+ }
2952
2992
  } else {
2953
2993
  var x = e.x;
2954
2994
  var y = e.y;
@@ -2978,6 +3018,10 @@ jSuites.contextmenu = (function(el, options) {
2978
3018
  }
2979
3019
  }
2980
3020
 
3021
+ obj.isOpened = function() {
3022
+ return el.classList.contains('jcontextmenu-focus') ? true : false;
3023
+ }
3024
+
2981
3025
  /**
2982
3026
  * Close menu
2983
3027
  */
@@ -8446,14 +8490,12 @@ jSuites.mask = (function() {
8446
8490
  if (o.mask.indexOf('##') !== -1) {
8447
8491
  var d = o.mask.split(';');
8448
8492
  if (d[0]) {
8449
- d[0] = d[0].replace('*', '');
8450
- d[0] = d[0].replace(/_/g, '');
8451
- d[0] = d[0].replace(/-/g, '');
8452
- d[0] = d[0].replace('(','');
8453
- d[0] = d[0].replace(')','');
8493
+ d[0] = d[0].replace('*', '\t');
8494
+ d[0] = d[0].replace(new RegExp(/_-/g), ' ');
8454
8495
  d[0] = d[0].replace('##0.###','##0.000');
8455
8496
  d[0] = d[0].replace('##0.##','##0.00');
8456
8497
  d[0] = d[0].replace('##0.#','##0.0');
8498
+ d[0] = d[0].replace(new RegExp(/\[.*?\]/),'');
8457
8499
  }
8458
8500
  o.mask = d[0];
8459
8501
  }
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "javascript plugins"
20
20
  ],
21
21
  "main": "dist/jsuites.js",
22
- "version": "4.11.6",
22
+ "version": "4.12.3",
23
23
  "bugs": "https://github.com/jsuites/jsuites/issues",
24
24
  "homepage": "https://github.com/jsuites/jsuites",
25
25
  "docs": "https://jsuites.net",