jsuites 5.0.10 → 5.0.12
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/README.md +4 -2
- package/dist/jsuites.js +13 -2
- package/dist/types/contextmenu.d.ts +43 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -113,7 +113,9 @@ contact@jsuites.net
|
|
|
113
113
|
|
|
114
114
|
## Other tools
|
|
115
115
|
|
|
116
|
-
https://lemonadejs.net<br>
|
|
117
|
-
https://
|
|
116
|
+
- [LemonadeJS v2](https://lemonadejs.net/v2/)<br>
|
|
117
|
+
- [LemonadeJS v3](https://lemonadejs.net/v3/)<br>
|
|
118
|
+
- [Jspreadsheet Pro v9](https://jspreadsheet.com/v9/)<br>
|
|
119
|
+
- [Jspreadsheet Pro v10](https://jspreadsheet.com/v10/)<br>
|
|
118
120
|
|
|
119
121
|
|
package/dist/jsuites.js
CHANGED
|
@@ -3026,7 +3026,7 @@ function Mask() {
|
|
|
3026
3026
|
} else if (s === 'DD') {
|
|
3027
3027
|
v = helpers.two(this.data[2]);
|
|
3028
3028
|
} else if (s === 'D') {
|
|
3029
|
-
v = this.data[2];
|
|
3029
|
+
v = parseInt(this.data[2]);
|
|
3030
3030
|
} else if (s === 'Q') {
|
|
3031
3031
|
v = Math.floor((calendar.getMonth() + 3) / 3);
|
|
3032
3032
|
} else if (s === 'HH24' || s === 'HH') {
|
|
@@ -3158,6 +3158,8 @@ function Calendar() {
|
|
|
3158
3158
|
dataType: null,
|
|
3159
3159
|
// Controls
|
|
3160
3160
|
controls: true,
|
|
3161
|
+
// Auto select
|
|
3162
|
+
autoSelect: true,
|
|
3161
3163
|
}
|
|
3162
3164
|
|
|
3163
3165
|
// Loop through our object
|
|
@@ -3297,6 +3299,9 @@ function Calendar() {
|
|
|
3297
3299
|
}
|
|
3298
3300
|
|
|
3299
3301
|
obj.close = function (ignoreEvents, update) {
|
|
3302
|
+
if (obj.options.autoSelect !== true && typeof(update) === 'undefined') {
|
|
3303
|
+
update = false;
|
|
3304
|
+
}
|
|
3300
3305
|
if (calendar.classList.contains('jcalendar-focus')) {
|
|
3301
3306
|
if (update !== false) {
|
|
3302
3307
|
var element = calendar.querySelector('.jcalendar-selected');
|
|
@@ -3310,6 +3315,12 @@ function Calendar() {
|
|
|
3310
3315
|
}
|
|
3311
3316
|
|
|
3312
3317
|
obj.setValue(value);
|
|
3318
|
+
} else {
|
|
3319
|
+
if (obj.options.value) {
|
|
3320
|
+
let value = obj.options.value;
|
|
3321
|
+
obj.options.value = '';
|
|
3322
|
+
obj.setValue(value)
|
|
3323
|
+
}
|
|
3313
3324
|
}
|
|
3314
3325
|
|
|
3315
3326
|
// Events
|
|
@@ -12518,7 +12529,7 @@ var sha512_default = /*#__PURE__*/__webpack_require__.n(sha512);
|
|
|
12518
12529
|
|
|
12519
12530
|
var jSuites = {
|
|
12520
12531
|
/** Current version */
|
|
12521
|
-
version: '5.0.
|
|
12532
|
+
version: '5.0.12',
|
|
12522
12533
|
/** Bind new extensions to Jsuites */
|
|
12523
12534
|
setExtensions: function(o) {
|
|
12524
12535
|
if (typeof(o) == 'object') {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface Items {
|
|
2
|
+
/** Context menu item type: line | divisor | default */
|
|
3
|
+
type?: 'line' | 'divisor' | 'default';
|
|
4
|
+
/** Context menu item title */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Context menu icon key. (Material icon key icon identification) */
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** HTML id property of the item DOM element */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Item is disabled */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Onclick event for the contextmenu item */
|
|
13
|
+
onclick?: (instance: object, e: MouseEvent) => void;
|
|
14
|
+
/** A short description or instruction for the item. Normally a shortcut. Ex. CTRL + C */
|
|
15
|
+
shortcut?: string;
|
|
16
|
+
/** Show this text when the user mouse over the element */
|
|
17
|
+
tooltip?: string;
|
|
18
|
+
/** Submenu */
|
|
19
|
+
submenu?: Array<Items>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Options {
|
|
23
|
+
/** Items for the contextmenu */
|
|
24
|
+
items: Items[],
|
|
25
|
+
/** General onclick handler */
|
|
26
|
+
onclick: null,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Toast Plugin */
|
|
30
|
+
export type Contextmenu = (el: HTMLElement, options: Options) => {
|
|
31
|
+
/** Close the color picker */
|
|
32
|
+
close: () => void;
|
|
33
|
+
/** Get the current color in hex */
|
|
34
|
+
create: (items: Items[]) => void;
|
|
35
|
+
/** Open the contextmenu. You can overwrite the items each time the menu is opened */
|
|
36
|
+
open: (event: MouseEvent, items?: Items[]) => void;
|
|
37
|
+
/** Open the contextmenu. You can overwrite the items each time the menu is opened */
|
|
38
|
+
options: Options;
|
|
39
|
+
/** Initial settings */
|
|
40
|
+
isOpened: () => boolean;
|
|
41
|
+
/** Internal type */
|
|
42
|
+
type: 'contextmenu';
|
|
43
|
+
}
|
package/package.json
CHANGED