jsuites 4.12.1 → 4.12.4

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.12.0';
20
+ var version = '4.12.4';
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
@@ -129,7 +133,7 @@ var jSuites = function(options) {
129
133
  isOpened(element);
130
134
  }
131
135
 
132
- var editorMouseUp = function(e) {
136
+ var mouseUp = function(e) {
133
137
  if (editorAction && editorAction.e) {
134
138
  if (typeof(editorAction.e.refresh) == 'function' && state.actioned) {
135
139
  editorAction.e.refresh();
@@ -146,7 +150,7 @@ var jSuites = function(options) {
146
150
  editorAction = false;
147
151
  }
148
152
 
149
- var editorMouseMove = function(e) {
153
+ var mouseMove = function(e) {
150
154
  if (editorAction) {
151
155
  var x = e.clientX || e.pageX;
152
156
  var y = e.clientY || e.pageY;
@@ -244,7 +248,31 @@ var jSuites = function(options) {
244
248
  }
245
249
  }
246
250
 
247
- 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) {
248
276
  var item = jSuites.findElement(e.target, 'jpanel');
249
277
  if (item && typeof(item.dblclick) == 'function') {
250
278
  // Create edition
@@ -252,7 +280,7 @@ var jSuites = function(options) {
252
280
  }
253
281
  }
254
282
 
255
- var editorContextmenu = function(e) {
283
+ var contextMenu = function(e) {
256
284
  var item = document.activeElement;
257
285
  if (item && typeof(item.contextmenu) == 'function') {
258
286
  // Create edition
@@ -279,7 +307,7 @@ var jSuites = function(options) {
279
307
  }
280
308
  }
281
309
 
282
- var editorKeyDown = function(e) {
310
+ var keyDown = function(e) {
283
311
  var item = document.activeElement;
284
312
  if (item) {
285
313
  if (e.key == "Delete" && typeof(item.delete) == 'function') {
@@ -300,12 +328,13 @@ var jSuites = function(options) {
300
328
  }
301
329
  }
302
330
 
303
- document.addEventListener('mouseup', editorMouseUp);
304
- document.addEventListener("mousedown", editorMouseDown);
305
- document.addEventListener('mousemove', editorMouseMove);
306
- document.addEventListener('dblclick', editorDblClick);
307
- document.addEventListener('keydown', editorKeyDown);
308
- 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);
309
338
  document.dictionary = {};
310
339
 
311
340
  obj.version = version;
@@ -1885,6 +1914,7 @@ jSuites.calendar.prettifyAll = function() {
1885
1914
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].getAttribute('data-date'));
1886
1915
  } else {
1887
1916
  if (elements[i].innerHTML) {
1917
+ elements[i].setAttribute('title', elements[i].innerHTML);
1888
1918
  elements[i].setAttribute('data-date', elements[i].innerHTML);
1889
1919
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].innerHTML);
1890
1920
  }
@@ -2308,7 +2338,7 @@ jSuites.color = (function(el, options) {
2308
2338
  }
2309
2339
 
2310
2340
  obj.select = function(color) {
2311
- // Remove current selecded mark
2341
+ // Remove current selected mark
2312
2342
  var selected = container.querySelector('.jcolor-selected');
2313
2343
  if (selected) {
2314
2344
  selected.classList.remove('jcolor-selected');
@@ -2318,6 +2348,8 @@ jSuites.color = (function(el, options) {
2318
2348
  if (obj.values[color]) {
2319
2349
  obj.values[color].classList.add('jcolor-selected');
2320
2350
  }
2351
+
2352
+ obj.options.value = color;
2321
2353
  }
2322
2354
 
2323
2355
  /**
@@ -8033,14 +8065,12 @@ jSuites.mask = (function() {
8033
8065
  if (o.mask.indexOf('##') !== -1) {
8034
8066
  var d = o.mask.split(';');
8035
8067
  if (d[0]) {
8036
- d[0] = d[0].replace('*', '');
8037
- d[0] = d[0].replace(/_/g, '');
8038
- d[0] = d[0].replace(/-/g, '');
8039
- d[0] = d[0].replace('(','');
8040
- d[0] = d[0].replace(')','');
8068
+ d[0] = d[0].replace('*', '\t');
8069
+ d[0] = d[0].replace(new RegExp(/_-/g), ' ');
8041
8070
  d[0] = d[0].replace('##0.###','##0.000');
8042
8071
  d[0] = d[0].replace('##0.##','##0.00');
8043
8072
  d[0] = d[0].replace('##0.#','##0.0');
8073
+ d[0] = d[0].replace(new RegExp(/\[.*?\]/),'');
8044
8074
  }
8045
8075
  o.mask = d[0];
8046
8076
  }
@@ -8135,6 +8165,9 @@ jSuites.mask = (function() {
8135
8165
  }
8136
8166
  }
8137
8167
 
8168
+ // Get the type of the mask
8169
+ obj.getType = getType;
8170
+
8138
8171
  // Extract the tokens from a mask
8139
8172
  obj.prepare = function(str, o) {
8140
8173
  if (! o) {
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;
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.12.0';
20
+ var version = '4.12.4';
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
@@ -129,7 +133,7 @@ var jSuites = function(options) {
129
133
  isOpened(element);
130
134
  }
131
135
 
132
- var editorMouseUp = function(e) {
136
+ var mouseUp = function(e) {
133
137
  if (editorAction && editorAction.e) {
134
138
  if (typeof(editorAction.e.refresh) == 'function' && state.actioned) {
135
139
  editorAction.e.refresh();
@@ -146,7 +150,7 @@ var jSuites = function(options) {
146
150
  editorAction = false;
147
151
  }
148
152
 
149
- var editorMouseMove = function(e) {
153
+ var mouseMove = function(e) {
150
154
  if (editorAction) {
151
155
  var x = e.clientX || e.pageX;
152
156
  var y = e.clientY || e.pageY;
@@ -244,7 +248,31 @@ var jSuites = function(options) {
244
248
  }
245
249
  }
246
250
 
247
- 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) {
248
276
  var item = jSuites.findElement(e.target, 'jpanel');
249
277
  if (item && typeof(item.dblclick) == 'function') {
250
278
  // Create edition
@@ -252,7 +280,7 @@ var jSuites = function(options) {
252
280
  }
253
281
  }
254
282
 
255
- var editorContextmenu = function(e) {
283
+ var contextMenu = function(e) {
256
284
  var item = document.activeElement;
257
285
  if (item && typeof(item.contextmenu) == 'function') {
258
286
  // Create edition
@@ -279,7 +307,7 @@ var jSuites = function(options) {
279
307
  }
280
308
  }
281
309
 
282
- var editorKeyDown = function(e) {
310
+ var keyDown = function(e) {
283
311
  var item = document.activeElement;
284
312
  if (item) {
285
313
  if (e.key == "Delete" && typeof(item.delete) == 'function') {
@@ -300,12 +328,13 @@ var jSuites = function(options) {
300
328
  }
301
329
  }
302
330
 
303
- document.addEventListener('mouseup', editorMouseUp);
304
- document.addEventListener("mousedown", editorMouseDown);
305
- document.addEventListener('mousemove', editorMouseMove);
306
- document.addEventListener('dblclick', editorDblClick);
307
- document.addEventListener('keydown', editorKeyDown);
308
- 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);
309
338
  document.dictionary = {};
310
339
 
311
340
  obj.version = version;
@@ -1896,6 +1925,7 @@ jSuites.calendar.prettifyAll = function() {
1896
1925
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].getAttribute('data-date'));
1897
1926
  } else {
1898
1927
  if (elements[i].innerHTML) {
1928
+ elements[i].setAttribute('title', elements[i].innerHTML);
1899
1929
  elements[i].setAttribute('data-date', elements[i].innerHTML);
1900
1930
  elements[i].innerHTML = jSuites.calendar.prettify(elements[i].innerHTML);
1901
1931
  }
@@ -2319,7 +2349,7 @@ jSuites.color = (function(el, options) {
2319
2349
  }
2320
2350
 
2321
2351
  obj.select = function(color) {
2322
- // Remove current selecded mark
2352
+ // Remove current selected mark
2323
2353
  var selected = container.querySelector('.jcolor-selected');
2324
2354
  if (selected) {
2325
2355
  selected.classList.remove('jcolor-selected');
@@ -2329,6 +2359,8 @@ jSuites.color = (function(el, options) {
2329
2359
  if (obj.values[color]) {
2330
2360
  obj.values[color].classList.add('jcolor-selected');
2331
2361
  }
2362
+
2363
+ obj.options.value = color;
2332
2364
  }
2333
2365
 
2334
2366
  /**
@@ -8458,14 +8490,12 @@ jSuites.mask = (function() {
8458
8490
  if (o.mask.indexOf('##') !== -1) {
8459
8491
  var d = o.mask.split(';');
8460
8492
  if (d[0]) {
8461
- d[0] = d[0].replace('*', '');
8462
- d[0] = d[0].replace(/_/g, '');
8463
- d[0] = d[0].replace(/-/g, '');
8464
- d[0] = d[0].replace('(','');
8465
- d[0] = d[0].replace(')','');
8493
+ d[0] = d[0].replace('*', '\t');
8494
+ d[0] = d[0].replace(new RegExp(/_-/g), ' ');
8466
8495
  d[0] = d[0].replace('##0.###','##0.000');
8467
8496
  d[0] = d[0].replace('##0.##','##0.00');
8468
8497
  d[0] = d[0].replace('##0.#','##0.0');
8498
+ d[0] = d[0].replace(new RegExp(/\[.*?\]/),'');
8469
8499
  }
8470
8500
  o.mask = d[0];
8471
8501
  }
@@ -8560,6 +8590,9 @@ jSuites.mask = (function() {
8560
8590
  }
8561
8591
  }
8562
8592
 
8593
+ // Get the type of the mask
8594
+ obj.getType = getType;
8595
+
8563
8596
  // Extract the tokens from a mask
8564
8597
  obj.prepare = function(str, o) {
8565
8598
  if (! o) {
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "javascript plugins"
20
20
  ],
21
21
  "main": "dist/jsuites.js",
22
- "version": "4.12.1",
22
+ "version": "4.12.4",
23
23
  "bugs": "https://github.com/jsuites/jsuites/issues",
24
24
  "homepage": "https://github.com/jsuites/jsuites",
25
25
  "docs": "https://jsuites.net",