cx 24.11.4 → 25.1.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.
@@ -1,391 +1,392 @@
1
- import { Widget, VDOM } from "../../ui/Widget";
2
- import { Culture } from "../../ui/Culture";
3
- import { KeyCode } from "../../util/KeyCode";
4
- import { WheelComponent } from "./Wheel";
5
- import { oneFocusOut, offFocusOut } from "../../ui/FocusManager";
6
-
7
- import { enableCultureSensitiveFormatting } from "../../ui/Format";
8
- enableCultureSensitiveFormatting();
9
-
10
- export class DateTimePicker extends Widget {
11
- declareData() {
12
- return super.declareData(...arguments, {
13
- value: undefined,
14
- });
15
- }
16
-
17
- render(context, instance, key) {
18
- return (
19
- <DateTimePickerComponent
20
- key={key}
21
- instance={instance}
22
- data={instance.data}
23
- size={this.size}
24
- segment={this.segment}
25
- />
26
- );
27
- }
28
- }
29
-
30
- DateTimePicker.prototype.baseClass = "datetimepicker";
31
- DateTimePicker.prototype.styled = true;
32
- DateTimePicker.prototype.size = 3;
33
- DateTimePicker.prototype.autoFocus = false;
34
- DateTimePicker.prototype.segment = "datetime";
35
- DateTimePicker.prototype.showSeconds = false;
36
-
37
- class DateTimePickerComponent extends VDOM.Component {
38
- constructor(props) {
39
- super(props);
40
- let date = props.data.value ? new Date(props.data.value) : new Date();
41
- if (isNaN(date.getTime())) date = new Date();
42
- this.state = {
43
- date: date,
44
- activeWheel: null,
45
- };
46
-
47
- let { widget } = props.instance;
48
-
49
- this.handleChange = this.handleChange.bind(this);
50
- this.onFocus = this.onFocus.bind(this);
51
- this.onBlur = this.onBlur.bind(this);
52
- this.onKeyDown = this.onKeyDown.bind(this);
53
-
54
- let showDate = props.segment.indexOf("date") !== -1;
55
- let showTime = props.segment.indexOf("time") !== -1;
56
-
57
- this.wheels = {
58
- year: showDate,
59
- month: showDate,
60
- date: showDate,
61
- hours: showTime,
62
- minutes: showTime,
63
- seconds: showTime && widget.showSeconds,
64
- };
65
-
66
- this.keyDownPipes = {};
67
- }
68
-
69
- UNSAFE_componentWillReceiveProps(props) {
70
- let date = props.data.value ? new Date(props.data.value) : new Date();
71
- if (isNaN(date.getTime())) date = new Date();
72
- this.setState({ date });
73
- }
74
-
75
- setDateComponent(date, component, value) {
76
- let v = new Date(date);
77
- switch (component) {
78
- case "year":
79
- v.setFullYear(value);
80
- break;
81
-
82
- case "month":
83
- v.setMonth(value);
84
- break;
85
-
86
- case "date":
87
- v.setDate(value);
88
- break;
89
-
90
- case "hours":
91
- v.setHours(value);
92
- break;
93
-
94
- case "minutes":
95
- v.setMinutes(value);
96
- break;
97
-
98
- case "seconds":
99
- v.setSeconds(value);
100
- break;
101
- }
102
- return v;
103
- }
104
-
105
- handleChange() {
106
- let encode = this.props.instance.widget.encoding || Culture.getDefaultDateEncoding();
107
- this.props.instance.set("value", encode(this.state.date));
108
- }
109
-
110
- render() {
111
- let { instance, data, size } = this.props;
112
- let { widget } = instance;
113
- let { CSS, baseClass } = widget;
114
- let date = this.state.date;
115
-
116
- let culture = Culture.getDateTimeCulture();
117
- let monthNames = culture.getMonthNames("short");
118
-
119
- let years = [];
120
- for (let y = 1970; y <= 2050; y++) years.push(<span key={y}>{y}</span>);
121
-
122
- let days = [];
123
- let start = new Date(date.getFullYear(), date.getMonth(), 1);
124
- while (start.getMonth() === date.getMonth()) {
125
- let day = start.getDate();
126
- days.push(<span key={day}>{day < 10 ? "0" + day : day}</span>);
127
- start.setDate(start.getDate() + 1);
128
- }
129
-
130
- let hours = [];
131
- for (let h = 0; h < 24; h++) {
132
- hours.push(<span key={h}>{h < 10 ? "0" + h : h}</span>);
133
- }
134
-
135
- let minutes = [];
136
- for (let m = 0; m < 60; m++) {
137
- minutes.push(<span key={m}>{m < 10 ? "0" + m : m}</span>);
138
- }
139
-
140
- return (
141
- <div
142
- tabIndex={0}
143
- ref={(el) => {
144
- this.el = el;
145
- }}
146
- className={data.classNames}
147
- onFocus={this.onFocus}
148
- onBlur={this.onBlur}
149
- onKeyDown={this.onKeyDown}
150
- >
151
- {this.wheels.year && (
152
- <WheelComponent
153
- size={size}
154
- CSS={CSS}
155
- active={this.state.activeWheel === "year"}
156
- baseClass={baseClass + "-wheel"}
157
- index={date.getFullYear() - 1970}
158
- onChange={(newIndex) => {
159
- this.setState(
160
- (state) => ({
161
- date: this.setDateComponent(this.state.date, "year", newIndex + 1970),
162
- }),
163
- this.handleChange
164
- );
165
- }}
166
- onPipeKeyDown={(kd) => {
167
- this.keyDownPipes["year"] = kd;
168
- }}
169
- onMouseDown={() => {
170
- this.setState({ activeWheel: "year" });
171
- }}
172
- >
173
- {years}
174
- </WheelComponent>
175
- )}
176
- {this.wheels.year && this.wheels.month && <span>-</span>}
177
- {this.wheels.month && (
178
- <WheelComponent
179
- size={size}
180
- CSS={CSS}
181
- active={this.state.activeWheel === "month"}
182
- baseClass={baseClass + "-wheel"}
183
- index={date.getMonth()}
184
- onChange={(newIndex) => {
185
- this.setState(
186
- (state) => ({
187
- date: this.setDateComponent(this.state.date, "month", newIndex),
188
- }),
189
- this.handleChange
190
- );
191
- }}
192
- onPipeKeyDown={(kd) => {
193
- this.keyDownPipes["month"] = kd;
194
- }}
195
- onMouseDown={() => {
196
- this.setState({ activeWheel: "month" });
197
- }}
198
- >
199
- {monthNames.map((m, i) => (
200
- <span key={i}>{m}</span>
201
- ))}
202
- </WheelComponent>
203
- )}
204
- {this.wheels.month && this.wheels.date && <span>-</span>}
205
- {this.wheels.date && (
206
- <WheelComponent
207
- size={size}
208
- CSS={CSS}
209
- active={this.state.activeWheel === "date"}
210
- baseClass={baseClass + "-wheel"}
211
- index={date.getDate() - 1}
212
- onChange={(newIndex) => {
213
- this.setState(
214
- (state) => ({
215
- date: this.setDateComponent(this.state.date, "date", newIndex + 1),
216
- }),
217
- this.handleChange
218
- );
219
- }}
220
- onPipeKeyDown={(kd) => {
221
- this.keyDownPipes["date"] = kd;
222
- }}
223
- onMouseDown={() => {
224
- this.setState({ activeWheel: "date" });
225
- }}
226
- >
227
- {days}
228
- </WheelComponent>
229
- )}
230
- {this.wheels.hours && this.wheels.year && <span className={CSS.element(baseClass, "spacer")} />}
231
- {this.wheels.hours && (
232
- <WheelComponent
233
- size={size}
234
- CSS={CSS}
235
- active={this.state.activeWheel === "hours"}
236
- baseClass={baseClass + "-wheel"}
237
- index={date.getHours()}
238
- onChange={(newIndex) => {
239
- this.setState(
240
- (state) => ({
241
- date: this.setDateComponent(this.state.date, "hours", newIndex),
242
- }),
243
- this.handleChange
244
- );
245
- }}
246
- onPipeKeyDown={(kd) => {
247
- this.keyDownPipes["hours"] = kd;
248
- }}
249
- onMouseDown={() => {
250
- this.setState({ activeWheel: "hours" });
251
- }}
252
- >
253
- {hours}
254
- </WheelComponent>
255
- )}
256
- {this.wheels.hours && this.wheels.minutes && <span>:</span>}
257
- {this.wheels.minutes && (
258
- <WheelComponent
259
- size={size}
260
- CSS={CSS}
261
- baseClass={baseClass + "-wheel"}
262
- active={this.state.activeWheel === "minutes"}
263
- index={date.getMinutes()}
264
- onChange={(newIndex) => {
265
- this.setState(
266
- (state) => ({
267
- date: this.setDateComponent(this.state.date, "minutes", newIndex),
268
- }),
269
- this.handleChange
270
- );
271
- }}
272
- onPipeKeyDown={(kd) => {
273
- this.keyDownPipes["minutes"] = kd;
274
- }}
275
- onMouseDown={() => {
276
- this.setState({ activeWheel: "minutes" });
277
- }}
278
- >
279
- {minutes}
280
- </WheelComponent>
281
- )}
282
- {this.wheels.minutes && this.wheels.seconds && <span>:</span>}
283
- {this.wheels.seconds && (
284
- <WheelComponent
285
- size={size}
286
- CSS={CSS}
287
- baseClass={baseClass + "-wheel"}
288
- active={this.state.activeWheel === "seconds"}
289
- index={date.getSeconds()}
290
- onChange={(newIndex) => {
291
- this.setState(
292
- (state) => ({
293
- date: this.setDateComponent(this.state.date, "seconds", newIndex),
294
- }),
295
- this.handleChange
296
- );
297
- }}
298
- onPipeKeyDown={(kd) => {
299
- this.keyDownPipes["seconds"] = kd;
300
- }}
301
- onMouseDown={() => {
302
- this.setState({ activeWheel: "seconds" });
303
- }}
304
- >
305
- {minutes}
306
- </WheelComponent>
307
- )}
308
- </div>
309
- );
310
- }
311
-
312
- componentDidMount() {
313
- if (this.props.instance.widget.autoFocus) this.el.focus();
314
- }
315
-
316
- componentWillUnmount() {
317
- offFocusOut(this);
318
- }
319
-
320
- onFocus() {
321
- oneFocusOut(this, this.el, this.onFocusOut.bind(this));
322
-
323
- if (!this.state.activeWheel) {
324
- let firstWheel = null;
325
- for (let wheel in this.wheels) {
326
- if (this.wheels[wheel]) {
327
- firstWheel = wheel;
328
- break;
329
- }
330
- }
331
-
332
- this.setState({
333
- activeWheel: firstWheel,
334
- });
335
- }
336
- }
337
-
338
- onFocusOut() {
339
- let { instance } = this.props;
340
- let { widget } = instance;
341
- if (widget.onFocusOut) instance.invoke("onFocusOut", null, instance);
342
- }
343
-
344
- onBlur() {
345
- this.setState({
346
- activeWheel: null,
347
- });
348
- }
349
-
350
- onKeyDown(e) {
351
- let tmp = null;
352
- let { instance } = this.props;
353
- switch (e.keyCode) {
354
- case KeyCode.right:
355
- e.preventDefault();
356
- for (let wheel in this.wheels) {
357
- if (this.wheels[wheel]) {
358
- if (tmp === this.state.activeWheel) {
359
- this.setState({ activeWheel: wheel });
360
- break;
361
- }
362
- tmp = wheel;
363
- }
364
- }
365
- break;
366
-
367
- case KeyCode.left:
368
- e.preventDefault();
369
- for (let wheel in this.wheels) {
370
- if (this.wheels[wheel]) {
371
- if (wheel === this.state.activeWheel && tmp) {
372
- this.setState({ activeWheel: tmp });
373
- break;
374
- }
375
- tmp = wheel;
376
- }
377
- }
378
- break;
379
-
380
- case KeyCode.enter:
381
- e.preventDefault();
382
- if (instance.widget.onSelect) instance.invoke("onSelect", e, instance, this.state.date);
383
- break;
384
-
385
- default:
386
- let kdp = this.keyDownPipes[this.state.activeWheel];
387
- if (kdp) kdp(e);
388
- break;
389
- }
390
- }
391
- }
1
+ import { Widget, VDOM } from "../../ui/Widget";
2
+ import { Culture } from "../../ui/Culture";
3
+ import { KeyCode } from "../../util/KeyCode";
4
+ import { WheelComponent } from "./Wheel";
5
+ import { oneFocusOut, offFocusOut } from "../../ui/FocusManager";
6
+
7
+ import { enableCultureSensitiveFormatting } from "../../ui/Format";
8
+ import { parseDateInvariant } from "../../util";
9
+ enableCultureSensitiveFormatting();
10
+
11
+ export class DateTimePicker extends Widget {
12
+ declareData() {
13
+ return super.declareData(...arguments, {
14
+ value: undefined,
15
+ });
16
+ }
17
+
18
+ render(context, instance, key) {
19
+ return (
20
+ <DateTimePickerComponent
21
+ key={key}
22
+ instance={instance}
23
+ data={instance.data}
24
+ size={this.size}
25
+ segment={this.segment}
26
+ />
27
+ );
28
+ }
29
+ }
30
+
31
+ DateTimePicker.prototype.baseClass = "datetimepicker";
32
+ DateTimePicker.prototype.styled = true;
33
+ DateTimePicker.prototype.size = 3;
34
+ DateTimePicker.prototype.autoFocus = false;
35
+ DateTimePicker.prototype.segment = "datetime";
36
+ DateTimePicker.prototype.showSeconds = false;
37
+
38
+ class DateTimePickerComponent extends VDOM.Component {
39
+ constructor(props) {
40
+ super(props);
41
+ let date = props.data.value ? parseDateInvariant(props.data.value) : new Date();
42
+ if (isNaN(date.getTime())) date = new Date();
43
+ this.state = {
44
+ date: date,
45
+ activeWheel: null,
46
+ };
47
+
48
+ let { widget } = props.instance;
49
+
50
+ this.handleChange = this.handleChange.bind(this);
51
+ this.onFocus = this.onFocus.bind(this);
52
+ this.onBlur = this.onBlur.bind(this);
53
+ this.onKeyDown = this.onKeyDown.bind(this);
54
+
55
+ let showDate = props.segment.indexOf("date") !== -1;
56
+ let showTime = props.segment.indexOf("time") !== -1;
57
+
58
+ this.wheels = {
59
+ year: showDate,
60
+ month: showDate,
61
+ date: showDate,
62
+ hours: showTime,
63
+ minutes: showTime,
64
+ seconds: showTime && widget.showSeconds,
65
+ };
66
+
67
+ this.keyDownPipes = {};
68
+ }
69
+
70
+ UNSAFE_componentWillReceiveProps(props) {
71
+ let date = props.data.value ? parseDateInvariant(props.data.value) : new Date();
72
+ if (isNaN(date.getTime())) date = new Date();
73
+ this.setState({ date });
74
+ }
75
+
76
+ setDateComponent(date, component, value) {
77
+ let v = new Date(date);
78
+ switch (component) {
79
+ case "year":
80
+ v.setFullYear(value);
81
+ break;
82
+
83
+ case "month":
84
+ v.setMonth(value);
85
+ break;
86
+
87
+ case "date":
88
+ v.setDate(value);
89
+ break;
90
+
91
+ case "hours":
92
+ v.setHours(value);
93
+ break;
94
+
95
+ case "minutes":
96
+ v.setMinutes(value);
97
+ break;
98
+
99
+ case "seconds":
100
+ v.setSeconds(value);
101
+ break;
102
+ }
103
+ return v;
104
+ }
105
+
106
+ handleChange() {
107
+ let encode = this.props.instance.widget.encoding || Culture.getDefaultDateEncoding();
108
+ this.props.instance.set("value", encode(this.state.date));
109
+ }
110
+
111
+ render() {
112
+ let { instance, data, size } = this.props;
113
+ let { widget } = instance;
114
+ let { CSS, baseClass } = widget;
115
+ let date = this.state.date;
116
+
117
+ let culture = Culture.getDateTimeCulture();
118
+ let monthNames = culture.getMonthNames("short");
119
+
120
+ let years = [];
121
+ for (let y = 1970; y <= 2050; y++) years.push(<span key={y}>{y}</span>);
122
+
123
+ let days = [];
124
+ let start = new Date(date.getFullYear(), date.getMonth(), 1);
125
+ while (start.getMonth() === date.getMonth()) {
126
+ let day = start.getDate();
127
+ days.push(<span key={day}>{day < 10 ? "0" + day : day}</span>);
128
+ start.setDate(start.getDate() + 1);
129
+ }
130
+
131
+ let hours = [];
132
+ for (let h = 0; h < 24; h++) {
133
+ hours.push(<span key={h}>{h < 10 ? "0" + h : h}</span>);
134
+ }
135
+
136
+ let minutes = [];
137
+ for (let m = 0; m < 60; m++) {
138
+ minutes.push(<span key={m}>{m < 10 ? "0" + m : m}</span>);
139
+ }
140
+
141
+ return (
142
+ <div
143
+ tabIndex={0}
144
+ ref={(el) => {
145
+ this.el = el;
146
+ }}
147
+ className={data.classNames}
148
+ onFocus={this.onFocus}
149
+ onBlur={this.onBlur}
150
+ onKeyDown={this.onKeyDown}
151
+ >
152
+ {this.wheels.year && (
153
+ <WheelComponent
154
+ size={size}
155
+ CSS={CSS}
156
+ active={this.state.activeWheel === "year"}
157
+ baseClass={baseClass + "-wheel"}
158
+ index={date.getFullYear() - 1970}
159
+ onChange={(newIndex) => {
160
+ this.setState(
161
+ (state) => ({
162
+ date: this.setDateComponent(this.state.date, "year", newIndex + 1970),
163
+ }),
164
+ this.handleChange,
165
+ );
166
+ }}
167
+ onPipeKeyDown={(kd) => {
168
+ this.keyDownPipes["year"] = kd;
169
+ }}
170
+ onMouseDown={() => {
171
+ this.setState({ activeWheel: "year" });
172
+ }}
173
+ >
174
+ {years}
175
+ </WheelComponent>
176
+ )}
177
+ {this.wheels.year && this.wheels.month && <span>-</span>}
178
+ {this.wheels.month && (
179
+ <WheelComponent
180
+ size={size}
181
+ CSS={CSS}
182
+ active={this.state.activeWheel === "month"}
183
+ baseClass={baseClass + "-wheel"}
184
+ index={date.getMonth()}
185
+ onChange={(newIndex) => {
186
+ this.setState(
187
+ (state) => ({
188
+ date: this.setDateComponent(this.state.date, "month", newIndex),
189
+ }),
190
+ this.handleChange,
191
+ );
192
+ }}
193
+ onPipeKeyDown={(kd) => {
194
+ this.keyDownPipes["month"] = kd;
195
+ }}
196
+ onMouseDown={() => {
197
+ this.setState({ activeWheel: "month" });
198
+ }}
199
+ >
200
+ {monthNames.map((m, i) => (
201
+ <span key={i}>{m}</span>
202
+ ))}
203
+ </WheelComponent>
204
+ )}
205
+ {this.wheels.month && this.wheels.date && <span>-</span>}
206
+ {this.wheels.date && (
207
+ <WheelComponent
208
+ size={size}
209
+ CSS={CSS}
210
+ active={this.state.activeWheel === "date"}
211
+ baseClass={baseClass + "-wheel"}
212
+ index={date.getDate() - 1}
213
+ onChange={(newIndex) => {
214
+ this.setState(
215
+ (state) => ({
216
+ date: this.setDateComponent(this.state.date, "date", newIndex + 1),
217
+ }),
218
+ this.handleChange,
219
+ );
220
+ }}
221
+ onPipeKeyDown={(kd) => {
222
+ this.keyDownPipes["date"] = kd;
223
+ }}
224
+ onMouseDown={() => {
225
+ this.setState({ activeWheel: "date" });
226
+ }}
227
+ >
228
+ {days}
229
+ </WheelComponent>
230
+ )}
231
+ {this.wheels.hours && this.wheels.year && <span className={CSS.element(baseClass, "spacer")} />}
232
+ {this.wheels.hours && (
233
+ <WheelComponent
234
+ size={size}
235
+ CSS={CSS}
236
+ active={this.state.activeWheel === "hours"}
237
+ baseClass={baseClass + "-wheel"}
238
+ index={date.getHours()}
239
+ onChange={(newIndex) => {
240
+ this.setState(
241
+ (state) => ({
242
+ date: this.setDateComponent(this.state.date, "hours", newIndex),
243
+ }),
244
+ this.handleChange,
245
+ );
246
+ }}
247
+ onPipeKeyDown={(kd) => {
248
+ this.keyDownPipes["hours"] = kd;
249
+ }}
250
+ onMouseDown={() => {
251
+ this.setState({ activeWheel: "hours" });
252
+ }}
253
+ >
254
+ {hours}
255
+ </WheelComponent>
256
+ )}
257
+ {this.wheels.hours && this.wheels.minutes && <span>:</span>}
258
+ {this.wheels.minutes && (
259
+ <WheelComponent
260
+ size={size}
261
+ CSS={CSS}
262
+ baseClass={baseClass + "-wheel"}
263
+ active={this.state.activeWheel === "minutes"}
264
+ index={date.getMinutes()}
265
+ onChange={(newIndex) => {
266
+ this.setState(
267
+ (state) => ({
268
+ date: this.setDateComponent(this.state.date, "minutes", newIndex),
269
+ }),
270
+ this.handleChange,
271
+ );
272
+ }}
273
+ onPipeKeyDown={(kd) => {
274
+ this.keyDownPipes["minutes"] = kd;
275
+ }}
276
+ onMouseDown={() => {
277
+ this.setState({ activeWheel: "minutes" });
278
+ }}
279
+ >
280
+ {minutes}
281
+ </WheelComponent>
282
+ )}
283
+ {this.wheels.minutes && this.wheels.seconds && <span>:</span>}
284
+ {this.wheels.seconds && (
285
+ <WheelComponent
286
+ size={size}
287
+ CSS={CSS}
288
+ baseClass={baseClass + "-wheel"}
289
+ active={this.state.activeWheel === "seconds"}
290
+ index={date.getSeconds()}
291
+ onChange={(newIndex) => {
292
+ this.setState(
293
+ (state) => ({
294
+ date: this.setDateComponent(this.state.date, "seconds", newIndex),
295
+ }),
296
+ this.handleChange,
297
+ );
298
+ }}
299
+ onPipeKeyDown={(kd) => {
300
+ this.keyDownPipes["seconds"] = kd;
301
+ }}
302
+ onMouseDown={() => {
303
+ this.setState({ activeWheel: "seconds" });
304
+ }}
305
+ >
306
+ {minutes}
307
+ </WheelComponent>
308
+ )}
309
+ </div>
310
+ );
311
+ }
312
+
313
+ componentDidMount() {
314
+ if (this.props.instance.widget.autoFocus) this.el.focus();
315
+ }
316
+
317
+ componentWillUnmount() {
318
+ offFocusOut(this);
319
+ }
320
+
321
+ onFocus() {
322
+ oneFocusOut(this, this.el, this.onFocusOut.bind(this));
323
+
324
+ if (!this.state.activeWheel) {
325
+ let firstWheel = null;
326
+ for (let wheel in this.wheels) {
327
+ if (this.wheels[wheel]) {
328
+ firstWheel = wheel;
329
+ break;
330
+ }
331
+ }
332
+
333
+ this.setState({
334
+ activeWheel: firstWheel,
335
+ });
336
+ }
337
+ }
338
+
339
+ onFocusOut() {
340
+ let { instance } = this.props;
341
+ let { widget } = instance;
342
+ if (widget.onFocusOut) instance.invoke("onFocusOut", null, instance);
343
+ }
344
+
345
+ onBlur() {
346
+ this.setState({
347
+ activeWheel: null,
348
+ });
349
+ }
350
+
351
+ onKeyDown(e) {
352
+ let tmp = null;
353
+ let { instance } = this.props;
354
+ switch (e.keyCode) {
355
+ case KeyCode.right:
356
+ e.preventDefault();
357
+ for (let wheel in this.wheels) {
358
+ if (this.wheels[wheel]) {
359
+ if (tmp === this.state.activeWheel) {
360
+ this.setState({ activeWheel: wheel });
361
+ break;
362
+ }
363
+ tmp = wheel;
364
+ }
365
+ }
366
+ break;
367
+
368
+ case KeyCode.left:
369
+ e.preventDefault();
370
+ for (let wheel in this.wheels) {
371
+ if (this.wheels[wheel]) {
372
+ if (wheel === this.state.activeWheel && tmp) {
373
+ this.setState({ activeWheel: tmp });
374
+ break;
375
+ }
376
+ tmp = wheel;
377
+ }
378
+ }
379
+ break;
380
+
381
+ case KeyCode.enter:
382
+ e.preventDefault();
383
+ if (instance.widget.onSelect) instance.invoke("onSelect", e, instance, this.state.date);
384
+ break;
385
+
386
+ default:
387
+ let kdp = this.keyDownPipes[this.state.activeWheel];
388
+ if (kdp) kdp(e);
389
+ break;
390
+ }
391
+ }
392
+ }