-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (44 loc) · 959 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import compose from 'uc-compose';
import html from 'uc-dom/methods';
import input from 'uc-input';
import transform from 'uc-input/transform';
import field from 'uc-input-field/field';
import pop from 'uc-input-field/pop';
import Calendar from 'uc-calendar';
const InputDate = function(opts) {
this.onValueChange = opts.onChange;
this.events = {};
this.addField({
name: opts.name,
title: opts.title
});
this.addPop({
pop: new Calendar({
locale: opts.locale,
back: opts.back,
forward: opts.forward
}),
direction: opts.direction
});
if (opts.value) {
this.pop.value(opts.value, true);
this.setValue(this.pop.toString());
}
this.addInput(opts);
this.transforms = [];
}
InputDate.prototype = compose(
html,
transform,
input,
field,
pop,
{
remove: function() {
this.removePop();
this.removeInput();
this.removeField();
}
}
);
export default InputDate;