handsontable 0.0.0-next-aa86b7d-20240104 → 0.0.0-next-104ae65-20240105
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +28 -35
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +53 -53
- package/dist/handsontable.js +28 -35
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/editors/dateEditor/dateEditor.js +23 -30
- package/editors/dateEditor/dateEditor.mjs +23 -30
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
@@ -5,7 +5,6 @@ require("core-js/modules/es.error.cause.js");
|
|
5
5
|
var _moment = _interopRequireDefault(require("moment"));
|
6
6
|
var _pikaday = _interopRequireDefault(require("@handsontable/pikaday"));
|
7
7
|
var _textEditor = require("../textEditor");
|
8
|
-
var _eventManager = _interopRequireDefault(require("../../eventManager"));
|
9
8
|
var _element = require("../../helpers/dom/element");
|
10
9
|
var _object = require("../../helpers/object");
|
11
10
|
var _unicode = require("../../helpers/unicode");
|
@@ -28,10 +27,6 @@ class DateEditor extends _textEditor.TextEditor {
|
|
28
27
|
* @type {string}
|
29
28
|
*/
|
30
29
|
_defineProperty(this, "defaultDateFormat", 'DD/MM/YYYY');
|
31
|
-
/**
|
32
|
-
* @type {boolean}
|
33
|
-
*/
|
34
|
-
_defineProperty(this, "isCellEdited", false);
|
35
30
|
/**
|
36
31
|
* @type {boolean}
|
37
32
|
*/
|
@@ -72,26 +67,16 @@ class DateEditor extends _textEditor.TextEditor {
|
|
72
67
|
this.datePicker.setAttribute('dir', this.hot.isRtl() ? 'rtl' : 'ltr');
|
73
68
|
(0, _element.addClass)(this.datePicker, 'htDatepickerHolder');
|
74
69
|
this.hot.rootDocument.body.appendChild(this.datePicker);
|
75
|
-
const eventManager = new _eventManager.default(this);
|
76
70
|
|
77
71
|
/**
|
78
72
|
* Prevent recognizing clicking on datepicker as clicking outside of table.
|
79
73
|
*/
|
80
|
-
eventManager.addEventListener(this.datePicker, 'mousedown', event => {
|
74
|
+
this.eventManager.addEventListener(this.datePicker, 'mousedown', event => {
|
81
75
|
if ((0, _element.hasClass)(event.target, 'pika-day')) {
|
82
76
|
this.hideDatepicker();
|
83
77
|
}
|
84
78
|
event.stopPropagation();
|
85
79
|
});
|
86
|
-
|
87
|
-
/**
|
88
|
-
* Prevent caret movement in the TEXTAREA when navigating over the date picker.
|
89
|
-
*/
|
90
|
-
eventManager.addEventListener(this.TEXTAREA, 'keydown', event => {
|
91
|
-
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.code)) {
|
92
|
-
event.preventDefault();
|
93
|
-
}
|
94
|
-
});
|
95
80
|
}
|
96
81
|
|
97
82
|
/**
|
@@ -132,13 +117,27 @@ class DateEditor extends _textEditor.TextEditor {
|
|
132
117
|
const editorContext = shortcutManager.getContext('editor');
|
133
118
|
super.open();
|
134
119
|
this.showDatepicker(event);
|
135
|
-
editorContext.
|
136
|
-
keys: [['
|
137
|
-
callback:
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
120
|
+
editorContext.addShortcuts([{
|
121
|
+
keys: [['ArrowLeft']],
|
122
|
+
callback: () => {
|
123
|
+
this.$datePicker.adjustDate('subtract', 1);
|
124
|
+
}
|
125
|
+
}, {
|
126
|
+
keys: [['ArrowRight']],
|
127
|
+
callback: () => {
|
128
|
+
this.$datePicker.adjustDate('add', 1);
|
129
|
+
}
|
130
|
+
}, {
|
131
|
+
keys: [['ArrowUp']],
|
132
|
+
callback: () => {
|
133
|
+
this.$datePicker.adjustDate('subtract', 7);
|
134
|
+
}
|
135
|
+
}, {
|
136
|
+
keys: [['ArrowDown']],
|
137
|
+
callback: () => {
|
138
|
+
this.$datePicker.adjustDate('add', 7);
|
139
|
+
}
|
140
|
+
}], {
|
142
141
|
group: SHORTCUTS_GROUP_EDITOR
|
143
142
|
});
|
144
143
|
}
|
@@ -172,13 +171,6 @@ class DateEditor extends _textEditor.TextEditor {
|
|
172
171
|
finishEditing() {
|
173
172
|
let restoreOriginalValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
174
173
|
let ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
175
|
-
if (restoreOriginalValue) {
|
176
|
-
// pressed ESC, restore original value
|
177
|
-
const value = this.originalValue;
|
178
|
-
if (value !== undefined) {
|
179
|
-
this.setValue(value);
|
180
|
-
}
|
181
|
-
}
|
182
174
|
super.finishEditing(restoreOriginalValue, ctrlDown);
|
183
175
|
}
|
184
176
|
|
@@ -260,6 +252,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
260
252
|
options.trigger = htInput;
|
261
253
|
options.container = this.datePicker;
|
262
254
|
options.bound = false;
|
255
|
+
options.keyboardInput = false;
|
263
256
|
options.format = options.format || this.defaultDateFormat;
|
264
257
|
options.reposition = options.reposition || false;
|
265
258
|
// Set the RTL to `false`. Due to the https://github.com/Pikaday/Pikaday/issues/647 bug, the layout direction
|
@@ -5,7 +5,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
5
5
|
import moment from 'moment';
|
6
6
|
import Pikaday from '@handsontable/pikaday';
|
7
7
|
import { TextEditor } from "../textEditor/index.mjs";
|
8
|
-
import EventManager from "../../eventManager.mjs";
|
9
8
|
import { addClass, hasClass, outerHeight, outerWidth } from "../../helpers/dom/element.mjs";
|
10
9
|
import { deepExtend } from "../../helpers/object.mjs";
|
11
10
|
import { isFunctionKey } from "../../helpers/unicode.mjs";
|
@@ -24,10 +23,6 @@ export class DateEditor extends TextEditor {
|
|
24
23
|
* @type {string}
|
25
24
|
*/
|
26
25
|
_defineProperty(this, "defaultDateFormat", 'DD/MM/YYYY');
|
27
|
-
/**
|
28
|
-
* @type {boolean}
|
29
|
-
*/
|
30
|
-
_defineProperty(this, "isCellEdited", false);
|
31
26
|
/**
|
32
27
|
* @type {boolean}
|
33
28
|
*/
|
@@ -68,26 +63,16 @@ export class DateEditor extends TextEditor {
|
|
68
63
|
this.datePicker.setAttribute('dir', this.hot.isRtl() ? 'rtl' : 'ltr');
|
69
64
|
addClass(this.datePicker, 'htDatepickerHolder');
|
70
65
|
this.hot.rootDocument.body.appendChild(this.datePicker);
|
71
|
-
const eventManager = new EventManager(this);
|
72
66
|
|
73
67
|
/**
|
74
68
|
* Prevent recognizing clicking on datepicker as clicking outside of table.
|
75
69
|
*/
|
76
|
-
eventManager.addEventListener(this.datePicker, 'mousedown', event => {
|
70
|
+
this.eventManager.addEventListener(this.datePicker, 'mousedown', event => {
|
77
71
|
if (hasClass(event.target, 'pika-day')) {
|
78
72
|
this.hideDatepicker();
|
79
73
|
}
|
80
74
|
event.stopPropagation();
|
81
75
|
});
|
82
|
-
|
83
|
-
/**
|
84
|
-
* Prevent caret movement in the TEXTAREA when navigating over the date picker.
|
85
|
-
*/
|
86
|
-
eventManager.addEventListener(this.TEXTAREA, 'keydown', event => {
|
87
|
-
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.code)) {
|
88
|
-
event.preventDefault();
|
89
|
-
}
|
90
|
-
});
|
91
76
|
}
|
92
77
|
|
93
78
|
/**
|
@@ -128,13 +113,27 @@ export class DateEditor extends TextEditor {
|
|
128
113
|
const editorContext = shortcutManager.getContext('editor');
|
129
114
|
super.open();
|
130
115
|
this.showDatepicker(event);
|
131
|
-
editorContext.
|
132
|
-
keys: [['
|
133
|
-
callback:
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
116
|
+
editorContext.addShortcuts([{
|
117
|
+
keys: [['ArrowLeft']],
|
118
|
+
callback: () => {
|
119
|
+
this.$datePicker.adjustDate('subtract', 1);
|
120
|
+
}
|
121
|
+
}, {
|
122
|
+
keys: [['ArrowRight']],
|
123
|
+
callback: () => {
|
124
|
+
this.$datePicker.adjustDate('add', 1);
|
125
|
+
}
|
126
|
+
}, {
|
127
|
+
keys: [['ArrowUp']],
|
128
|
+
callback: () => {
|
129
|
+
this.$datePicker.adjustDate('subtract', 7);
|
130
|
+
}
|
131
|
+
}, {
|
132
|
+
keys: [['ArrowDown']],
|
133
|
+
callback: () => {
|
134
|
+
this.$datePicker.adjustDate('add', 7);
|
135
|
+
}
|
136
|
+
}], {
|
138
137
|
group: SHORTCUTS_GROUP_EDITOR
|
139
138
|
});
|
140
139
|
}
|
@@ -168,13 +167,6 @@ export class DateEditor extends TextEditor {
|
|
168
167
|
finishEditing() {
|
169
168
|
let restoreOriginalValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
170
169
|
let ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
171
|
-
if (restoreOriginalValue) {
|
172
|
-
// pressed ESC, restore original value
|
173
|
-
const value = this.originalValue;
|
174
|
-
if (value !== undefined) {
|
175
|
-
this.setValue(value);
|
176
|
-
}
|
177
|
-
}
|
178
170
|
super.finishEditing(restoreOriginalValue, ctrlDown);
|
179
171
|
}
|
180
172
|
|
@@ -256,6 +248,7 @@ export class DateEditor extends TextEditor {
|
|
256
248
|
options.trigger = htInput;
|
257
249
|
options.container = this.datePicker;
|
258
250
|
options.bound = false;
|
251
|
+
options.keyboardInput = false;
|
259
252
|
options.format = options.format || this.defaultDateFormat;
|
260
253
|
options.reposition = options.reposition || false;
|
261
254
|
// Set the RTL to `false`. Due to the https://github.com/Pikaday/Pikaday/issues/647 bug, the layout direction
|
package/helpers/mixed.js
CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
|
|
134
134
|
function _injectProductInfo(key, element) {
|
135
135
|
const hasValidType = !isEmpty(key);
|
136
136
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
137
|
-
const hotVersion = "0.0.0-next-
|
137
|
+
const hotVersion = "0.0.0-next-104ae65-20240105";
|
138
138
|
let keyValidityDate;
|
139
139
|
let consoleMessageState = 'invalid';
|
140
140
|
let domMessageState = 'invalid';
|
package/helpers/mixed.mjs
CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
|
|
124
124
|
export function _injectProductInfo(key, element) {
|
125
125
|
const hasValidType = !isEmpty(key);
|
126
126
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
127
|
-
const hotVersion = "0.0.0-next-
|
127
|
+
const hotVersion = "0.0.0-next-104ae65-20240105";
|
128
128
|
let keyValidityDate;
|
129
129
|
let consoleMessageState = 'invalid';
|
130
130
|
let domMessageState = 'invalid';
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"url": "https://github.com/handsontable/handsontable/issues"
|
11
11
|
},
|
12
12
|
"author": "Handsoncode <hello@handsontable.com>",
|
13
|
-
"version": "0.0.0-next-
|
13
|
+
"version": "0.0.0-next-104ae65-20240105",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|