aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/util
diff options
context:
space:
mode:
authoryiminghe <yiminghe@gmail.com>2016-08-04 19:53:55 +0800
committeryiminghe <yiminghe@gmail.com>2016-08-04 19:53:55 +0800
commit4984ed85e54f442998a335db70618d6184fa397e (patch)
tree6ae348b2cac5f48f3afb6f7b8dd0c2fd02f044fc /src/util
parentdeaa6062ea2e274d50d58c70251c1237c0c03c67 (diff)
downloadtime-picker-4984ed85e54f442998a335db70618d6184fa397e.tar.gz
time-picker-4984ed85e54f442998a335db70618d6184fa397e.tar.zst
time-picker-4984ed85e54f442998a335db70618d6184fa397e.zip
2.x :boom:2.0.0
Diffstat (limited to 'src/util')
-rw-r--r--src/util/index.js8
-rw-r--r--src/util/placements.js35
-rw-r--r--src/util/selection.js17
3 files changed, 0 insertions, 60 deletions
diff --git a/src/util/index.js b/src/util/index.js
deleted file mode 100644
index 5bc0a78..0000000
--- a/src/util/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
1import DateTimeFormat from 'gregorian-calendar-format';
2
3export function getFormatter(format, locale) {
4 if (typeof format === 'string') {
5 return new DateTimeFormat(format, locale.format);
6 }
7 return format;
8}
diff --git a/src/util/placements.js b/src/util/placements.js
deleted file mode 100644
index 6760286..0000000
--- a/src/util/placements.js
+++ /dev/null
@@ -1,35 +0,0 @@
1const autoAdjustOverflow = {
2 adjustX: 1,
3 adjustY: 1,
4};
5
6const targetOffset = [0, 0];
7
8const placements = {
9 bottomLeft: {
10 points: ['tl', 'tl'],
11 overflow: autoAdjustOverflow,
12 offset: [0, -3],
13 targetOffset,
14 },
15 bottomRight: {
16 points: ['tr', 'tr'],
17 overflow: autoAdjustOverflow,
18 offset: [0, -3],
19 targetOffset,
20 },
21 topRight: {
22 points: ['br', 'br'],
23 overflow: autoAdjustOverflow,
24 offset: [0, 3],
25 targetOffset,
26 },
27 topLeft: {
28 points: ['bl', 'bl'],
29 overflow: autoAdjustOverflow,
30 offset: [0, 3],
31 targetOffset,
32 },
33};
34
35export default placements;
diff --git a/src/util/selection.js b/src/util/selection.js
deleted file mode 100644
index 395901e..0000000
--- a/src/util/selection.js
+++ /dev/null
@@ -1,17 +0,0 @@
1export default function createSelection(field, start, end) {
2 if (field.createTextRange) {
3 const selRange = field.createTextRange();
4 selRange.collapse(true);
5 selRange.moveStart('character', start);
6 selRange.moveEnd('character', end);
7 selRange.select();
8 field.focus();
9 } else if (field.setSelectionRange) {
10 field.focus();
11 field.setSelectionRange(start, end);
12 } else if (typeof field.selectionStart !== 'undefined') {
13 field.selectionStart = start;
14 field.selectionEnd = end;
15 field.focus();
16 }
17}