Skip to content

Commit 4c278f7

Browse files
committed
rebuild
1 parent a01fcd1 commit 4c278f7

11 files changed

Lines changed: 237 additions & 44 deletions

File tree

dist/react-widgets.js

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,15 @@ return /******/ (function(modules) { // webpackBootstrap
428428

429429
if (duration <= 0) setTimeout(done.bind(null, fakeEvent), 0);
430430

431+
return {
432+
cancel: function cancel() {
433+
if (fired) return;
434+
fired = true;
435+
_domHelpersEventsOff2['default'](event.target, _domHelpersTransitionProperties2['default'].end, done);
436+
_domHelpersStyle2['default'](node, reset);
437+
}
438+
};
439+
431440
function done(event) {
432441
if (event.target !== event.currentTarget) return;
433442

@@ -899,14 +908,16 @@ return /******/ (function(modules) { // webpackBootstrap
899908
function createWrapper() {
900909
var dummy = {};
901910

902-
['formats', 'parse', 'format', 'firstOfWeek', 'precision'].forEach(function (name) {
903-
return Object.defineProperty(dummy, name, {
904-
enumerable: true,
905-
get: function get() {
906-
throw new Error('[React Widgets] You are attempting to use a widget that requires localization ' + '(Calendar, DateTimePicker, NumberPicker). ' + 'However there is no localizer set. Please configure a localizer. \n\n' + 'see http://jquense.github.io/react-widgets/docs/#/i18n for more info.');
907-
}
911+
if (process.env.NODE_ENV !== 'production') {
912+
['formats', 'parse', 'format', 'firstOfWeek', 'precision'].forEach(function (name) {
913+
return Object.defineProperty(dummy, name, {
914+
enumerable: true,
915+
get: function get() {
916+
throw new Error('[React Widgets] You are attempting to use a widget that requires localization ' + '(Calendar, DateTimePicker, NumberPicker). ' + 'However there is no localizer set. Please configure a localizer. \n\n' + 'see http://jquense.github.io/react-widgets/docs/#/i18n for more info.');
917+
}
918+
});
908919
});
909-
});
920+
}
910921
return dummy;
911922
}
912923
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
@@ -1742,6 +1753,10 @@ return /******/ (function(modules) { // webpackBootstrap
17421753

17431754
var transform = _utilConfiguration2['default'].animate.transform;
17441755

1756+
var CLOSING = 0,
1757+
OPENING = 1,
1758+
NONE = 2;
1759+
17451760
function properties(prop, value) {
17461761
var _ref, _ref2;
17471762

@@ -1816,6 +1831,13 @@ return /******/ (function(modules) { // webpackBootstrap
18161831
opening = !pvProps.open && this.props.open,
18171832
open = this.props.open;
18181833

1834+
if (pvProps.dropUp !== this.props.dropUp && this.transitionState !== NONE) {
1835+
this._transition && this._transition.cancel();
1836+
this.reset();
1837+
opening = this.transitionState === OPENING;
1838+
closing = this.transitionState === CLOSING;
1839+
}
1840+
18191841
if (opening) this.open();else if (closing) this.close();else if (open) this.height();
18201842
},
18211843

@@ -1863,7 +1885,7 @@ return /******/ (function(modules) { // webpackBootstrap
18631885
content = _utilCompat2['default'].findDOMNode(this.refs.content),
18641886
margin = parseInt(_domHelpersStyle2['default'](content, 'margin-top'), 10) + parseInt(_domHelpersStyle2['default'](content, 'margin-bottom'), 10);
18651887

1866-
var height = _domHelpersQueryHeight2['default'](content) + (isNaN(margin) ? 0 : margin);
1888+
var height = (_domHelpersQueryHeight2['default'](content) || 0) + (isNaN(margin) ? 0 : margin);
18671889

18681890
if (this.state.height !== height) {
18691891
el.style.height = height + 'px';
@@ -1872,12 +1894,14 @@ return /******/ (function(modules) { // webpackBootstrap
18721894
},
18731895

18741896
open: function open() {
1897+
var _this = this;
1898+
18751899
var self = this,
18761900
anim = _utilCompat2['default'].findDOMNode(this),
18771901
el = _utilCompat2['default'].findDOMNode(this.refs.content);
18781902

18791903
this.ORGINAL_POSITION = _domHelpersStyle2['default'](el, 'position');
1880-
this._isOpening = true;
1904+
this.transitionState = OPENING;
18811905

18821906
if (this._initialPosition) {
18831907
this._initialPosition = false;
@@ -1889,43 +1913,47 @@ return /******/ (function(modules) { // webpackBootstrap
18891913
anim.className += ' rw-popup-animating';
18901914
el.style.position = 'absolute';
18911915

1892-
_utilConfiguration2['default'].animate(el, { top: 0 }, self.props.duration, 'ease', function () {
1893-
if (!self._isOpening) return;
1916+
this._transition = _utilConfiguration2['default'].animate(el, { top: 0 }, self.props.duration, 'ease', function () {
1917+
if (_this.transitionState !== OPENING) return;
18941918

1919+
_this.transitionState = NONE;
18951920
anim.className = anim.className.replace(/ ?rw-popup-animating/g, '');
18961921

18971922
el.style.position = self.ORGINAL_POSITION;
18981923
anim.style.overflow = 'visible';
1899-
self.ORGINAL_POSITION = null;
1924+
_this.ORGINAL_POSITION = null;
19001925

1901-
self.props.onOpen();
1926+
_this.props.onOpen();
19021927
});
19031928
},
19041929

19051930
close: function close(dur) {
1906-
var self = this,
1907-
el = _utilCompat2['default'].findDOMNode(this.refs.content),
1931+
var _this2 = this;
1932+
1933+
var el = _utilCompat2['default'].findDOMNode(this.refs.content),
19081934
anim = _utilCompat2['default'].findDOMNode(this);
19091935

19101936
this.ORGINAL_POSITION = _domHelpersStyle2['default'](el, 'position');
19111937

1912-
this._isOpening = false;
1938+
this.transitionState = CLOSING;
1939+
19131940
this.height();
19141941
this.props.onClosing();
19151942

19161943
anim.style.overflow = 'hidden';
19171944
anim.className += ' rw-popup-animating';
19181945
el.style.position = 'absolute';
19191946

1920-
_utilConfiguration2['default'].animate(el, { top: this.props.dropUp ? '100%' : '-100%' }, dur === undefined ? this.props.duration : dur, 'ease', function () {
1921-
if (self._isOpening) return;
1947+
this._transition = _utilConfiguration2['default'].animate(el, { top: this.props.dropUp ? '100%' : '-100%' }, dur === undefined ? this.props.duration : dur, 'ease', function () {
1948+
if (_this2.transitionState !== CLOSING) return;
19221949

1950+
_this2.transitionState = NONE;
19231951
el.style.position = self.ORGINAL_POSITION;
19241952
anim.className = anim.className.replace(/ ?rw-popup-animating/g, '');
19251953

19261954
anim.style.display = 'none';
1927-
self.ORGINAL_POSITION = null;
1928-
self.props.onClose();
1955+
_this2.ORGINAL_POSITION = null;
1956+
_this2.props.onClose();
19291957
});
19301958
}
19311959

@@ -4958,7 +4986,11 @@ return /******/ (function(modules) { // webpackBootstrap
49584986
}, msgs);
49594987
}
49604988

4961-
exports['default'] = _uncontrollable2['default'](Calendar, { value: 'onChange' });
4989+
exports['default'] = _uncontrollable2['default'](Calendar, {
4990+
value: 'onChange',
4991+
viewDate: 'onViewDateChange',
4992+
view: 'onViewChange'
4993+
});
49624994
module.exports = exports['default'];
49634995

49644996
/***/ },
@@ -8413,10 +8445,15 @@ return /******/ (function(modules) { // webpackBootstrap
84138445

84148446
if (altKey) this.close();else if (isOpen) this.setState(babelHelpers._extends({ focusedItem: prev }, nullTag));
84158447
} else if (key === 'End') {
8448+
e.preventDefault();
84168449
if (isOpen) this.setState(babelHelpers._extends({ focusedItem: list.last() }, nullTag));else tagList && this.setState({ focusedTag: tagList.last() });
84178450
} else if (key === 'Home') {
8451+
e.preventDefault();
84188452
if (isOpen) this.setState(babelHelpers._extends({ focusedItem: list.first() }, nullTag));else tagList && this.setState({ focusedTag: tagList.first() });
8419-
} else if (isOpen && key === 'Enter') ctrlKey && this.props.onCreate || focusedItem === null ? this._onCreate(this.props.searchTerm) : this._onSelect(this.state.focusedItem);else if (key === 'Escape') isOpen ? this.close() : tagList && this.setState(nullTag);else if (noSearch && key === 'ArrowLeft') tagList && this.setState({ focusedTag: tagList.prev(focusedTag) });else if (noSearch && key === 'ArrowRight') tagList && this.setState({ focusedTag: tagList.next(focusedTag) });else if (noSearch && key === 'Delete') tagList && tagList.remove(focusedTag);else if (noSearch && key === 'Backspace') tagList && tagList.removeNext();
8453+
} else if (isOpen && key === 'Enter') {
8454+
e.preventDefault();
8455+
ctrlKey && this.props.onCreate || focusedItem === null ? this._onCreate(this.props.searchTerm) : this._onSelect(this.state.focusedItem);
8456+
} else if (key === 'Escape') isOpen ? this.close() : tagList && this.setState(nullTag);else if (noSearch && key === 'ArrowLeft') tagList && this.setState({ focusedTag: tagList.prev(focusedTag) });else if (noSearch && key === 'ArrowRight') tagList && this.setState({ focusedTag: tagList.next(focusedTag) });else if (noSearch && key === 'Delete') tagList && tagList.remove(focusedTag);else if (noSearch && key === 'Backspace') tagList && tagList.removeNext();
84208457
}
84218458
}, {
84228459
key: 'change',

docs/public/docs.js

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/public/rw-widgets.eot

5.68 KB
Binary file not shown.

docs/public/rw-widgets.svg

Lines changed: 18 additions & 0 deletions
Loading

docs/public/rw-widgets.ttf

5.51 KB
Binary file not shown.

docs/public/vendor.bundle.js

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Calendar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,5 +478,9 @@ function msgs(msgs) {
478478
}, msgs);
479479
}
480480

481-
exports['default'] = _uncontrollable2['default'](Calendar, { value: 'onChange' });
481+
exports['default'] = _uncontrollable2['default'](Calendar, {
482+
value: 'onChange',
483+
viewDate: 'onViewDateChange',
484+
view: 'onViewChange'
485+
});
482486
module.exports = exports['default'];

lib/Multiselect.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,15 @@ var Multiselect = _react2['default'].createClass(babelHelpers.createDecoratedObj
491491

492492
if (altKey) this.close();else if (isOpen) this.setState(babelHelpers._extends({ focusedItem: prev }, nullTag));
493493
} else if (key === 'End') {
494+
e.preventDefault();
494495
if (isOpen) this.setState(babelHelpers._extends({ focusedItem: list.last() }, nullTag));else tagList && this.setState({ focusedTag: tagList.last() });
495496
} else if (key === 'Home') {
497+
e.preventDefault();
496498
if (isOpen) this.setState(babelHelpers._extends({ focusedItem: list.first() }, nullTag));else tagList && this.setState({ focusedTag: tagList.first() });
497-
} else if (isOpen && key === 'Enter') ctrlKey && this.props.onCreate || focusedItem === null ? this._onCreate(this.props.searchTerm) : this._onSelect(this.state.focusedItem);else if (key === 'Escape') isOpen ? this.close() : tagList && this.setState(nullTag);else if (noSearch && key === 'ArrowLeft') tagList && this.setState({ focusedTag: tagList.prev(focusedTag) });else if (noSearch && key === 'ArrowRight') tagList && this.setState({ focusedTag: tagList.next(focusedTag) });else if (noSearch && key === 'Delete') tagList && tagList.remove(focusedTag);else if (noSearch && key === 'Backspace') tagList && tagList.removeNext();
499+
} else if (isOpen && key === 'Enter') {
500+
e.preventDefault();
501+
ctrlKey && this.props.onCreate || focusedItem === null ? this._onCreate(this.props.searchTerm) : this._onSelect(this.state.focusedItem);
502+
} else if (key === 'Escape') isOpen ? this.close() : tagList && this.setState(nullTag);else if (noSearch && key === 'ArrowLeft') tagList && this.setState({ focusedTag: tagList.prev(focusedTag) });else if (noSearch && key === 'ArrowRight') tagList && this.setState({ focusedTag: tagList.next(focusedTag) });else if (noSearch && key === 'Delete') tagList && tagList.remove(focusedTag);else if (noSearch && key === 'Backspace') tagList && tagList.removeNext();
498503
}
499504
}, {
500505
key: 'change',

lib/Popup.js

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat);
2828

2929
var transform = _utilConfiguration2['default'].animate.transform;
3030

31+
var CLOSING = 0,
32+
OPENING = 1,
33+
NONE = 2;
34+
3135
function properties(prop, value) {
3236
var _ref, _ref2;
3337

@@ -102,6 +106,13 @@ module.exports = _react2['default'].createClass({
102106
opening = !pvProps.open && this.props.open,
103107
open = this.props.open;
104108

109+
if (pvProps.dropUp !== this.props.dropUp && this.transitionState !== NONE) {
110+
this._transition && this._transition.cancel();
111+
this.reset();
112+
opening = this.transitionState === OPENING;
113+
closing = this.transitionState === CLOSING;
114+
}
115+
105116
if (opening) this.open();else if (closing) this.close();else if (open) this.height();
106117
},
107118

@@ -149,7 +160,7 @@ module.exports = _react2['default'].createClass({
149160
content = _utilCompat2['default'].findDOMNode(this.refs.content),
150161
margin = parseInt(_domHelpersStyle2['default'](content, 'margin-top'), 10) + parseInt(_domHelpersStyle2['default'](content, 'margin-bottom'), 10);
151162

152-
var height = _domHelpersQueryHeight2['default'](content) + (isNaN(margin) ? 0 : margin);
163+
var height = (_domHelpersQueryHeight2['default'](content) || 0) + (isNaN(margin) ? 0 : margin);
153164

154165
if (this.state.height !== height) {
155166
el.style.height = height + 'px';
@@ -158,12 +169,14 @@ module.exports = _react2['default'].createClass({
158169
},
159170

160171
open: function open() {
172+
var _this = this;
173+
161174
var self = this,
162175
anim = _utilCompat2['default'].findDOMNode(this),
163176
el = _utilCompat2['default'].findDOMNode(this.refs.content);
164177

165178
this.ORGINAL_POSITION = _domHelpersStyle2['default'](el, 'position');
166-
this._isOpening = true;
179+
this.transitionState = OPENING;
167180

168181
if (this._initialPosition) {
169182
this._initialPosition = false;
@@ -175,43 +188,47 @@ module.exports = _react2['default'].createClass({
175188
anim.className += ' rw-popup-animating';
176189
el.style.position = 'absolute';
177190

178-
_utilConfiguration2['default'].animate(el, { top: 0 }, self.props.duration, 'ease', function () {
179-
if (!self._isOpening) return;
191+
this._transition = _utilConfiguration2['default'].animate(el, { top: 0 }, self.props.duration, 'ease', function () {
192+
if (_this.transitionState !== OPENING) return;
180193

194+
_this.transitionState = NONE;
181195
anim.className = anim.className.replace(/ ?rw-popup-animating/g, '');
182196

183197
el.style.position = self.ORGINAL_POSITION;
184198
anim.style.overflow = 'visible';
185-
self.ORGINAL_POSITION = null;
199+
_this.ORGINAL_POSITION = null;
186200

187-
self.props.onOpen();
201+
_this.props.onOpen();
188202
});
189203
},
190204

191205
close: function close(dur) {
192-
var self = this,
193-
el = _utilCompat2['default'].findDOMNode(this.refs.content),
206+
var _this2 = this;
207+
208+
var el = _utilCompat2['default'].findDOMNode(this.refs.content),
194209
anim = _utilCompat2['default'].findDOMNode(this);
195210

196211
this.ORGINAL_POSITION = _domHelpersStyle2['default'](el, 'position');
197212

198-
this._isOpening = false;
213+
this.transitionState = CLOSING;
214+
199215
this.height();
200216
this.props.onClosing();
201217

202218
anim.style.overflow = 'hidden';
203219
anim.className += ' rw-popup-animating';
204220
el.style.position = 'absolute';
205221

206-
_utilConfiguration2['default'].animate(el, { top: this.props.dropUp ? '100%' : '-100%' }, dur === undefined ? this.props.duration : dur, 'ease', function () {
207-
if (self._isOpening) return;
222+
this._transition = _utilConfiguration2['default'].animate(el, { top: this.props.dropUp ? '100%' : '-100%' }, dur === undefined ? this.props.duration : dur, 'ease', function () {
223+
if (_this2.transitionState !== CLOSING) return;
208224

225+
_this2.transitionState = NONE;
209226
el.style.position = self.ORGINAL_POSITION;
210227
anim.className = anim.className.replace(/ ?rw-popup-animating/g, '');
211228

212229
anim.style.display = 'none';
213-
self.ORGINAL_POSITION = null;
214-
self.props.onClose();
230+
_this2.ORGINAL_POSITION = null;
231+
_this2.props.onClose();
215232
});
216233
}
217234

lib/util/dom/animate.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ function animate(node, properties, duration, easing, callback) {
8888

8989
if (duration <= 0) setTimeout(done.bind(null, fakeEvent), 0);
9090

91+
return {
92+
cancel: function cancel() {
93+
if (fired) return;
94+
fired = true;
95+
_domHelpersEventsOff2['default'](event.target, _domHelpersTransitionProperties2['default'].end, done);
96+
_domHelpersStyle2['default'](node, reset);
97+
}
98+
};
99+
91100
function done(event) {
92101
if (event.target !== event.currentTarget) return;
93102

0 commit comments

Comments
 (0)