react-ui-basics 0.0.170 → 0.0.173

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.
@@ -10,7 +10,7 @@ import ReactCreateElement from './ReactCreateElement.js';
10
10
  import PropTypes from 'prop-types';
11
11
  import TextField from './TextField.js';
12
12
  import FilteredList, { getLabel } from './FilteredList.js';
13
- import { isString, memo, continuousIncludes, orNoop, preventDefault, stopPropagation, getRandomId, isFunction, isObject, addEventListener, DOCUMENT, removeEventListener, UNDEFINED, classNames, ref } from './Tools.js';
13
+ import { isString, memo, continuousIncludes, orNoop, isFunction, preventDefault, stopPropagation, getRandomId, isObject, addEventListener, DOCUMENT, removeEventListener, UNDEFINED, classNames, ref } from './Tools.js';
14
14
  import Button from './Button.js';
15
15
  import MaterialIcon from './MaterialIcon.js';
16
16
  import { PureComponent } from './ReactConstants.js';
@@ -115,6 +115,8 @@ var AutocompleteSelect = function (_PureComponent) {
115
115
  var _this$state = __state(_this),
116
116
  filterValue = _this$state.filterValue,
117
117
  currentSelection = _this$state.selected;
118
+ var _this$props$labels = __props(_this).labels,
119
+ labels = _this$props$labels === void 0 ? {} : _this$props$labels;
118
120
  if (selectedId == null && (!!filterValue || !required) && allowCustom && (!_this.input || !_this.input.check())) selectedId = filterValue.trim();
119
121
  var isMultiSelect = isMultipleSelect(mode);
120
122
  if (!selectedId && isMultiSelect) {
@@ -132,10 +134,17 @@ var AutocompleteSelect = function (_PureComponent) {
132
134
  }
133
135
  var errored = required && Object.keys(selected) === 0;
134
136
  var isActive = mode === MODE_MULTIPLE_MINI_INLINE || isMultiSelect && isSelected;
137
+ var customValue = '';
138
+ if (allowCustom && selectedId) {
139
+ var label;
140
+ if (isFunction(labels)) label = labels(selectedId);else label = labels[selectedId];
141
+ if (label && isString(label)) customValue = label;
142
+ }
143
+ var filterValueWithCustom = isMultiSelect ? '' : customValue;
135
144
  _this.setState({
136
145
  isActive: isActive,
137
146
  selected: selected,
138
- filterValue: isMultiSelect ? '' : allowCustom ? selectedId || '' : '',
147
+ filterValue: filterValueWithCustom,
139
148
  errored: errored
140
149
  });
141
150
  if (isActive && _this.input) _this.input.getInput().focus();
package/FilteredList.js CHANGED
@@ -1,154 +1,251 @@
1
1
  import ReactConstants from "./ReactConstants";
2
2
  import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
3
-
4
- import { jsx as jsxRuntime_2 } from 'react/jsx-runtime';
3
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass, objectSpread2 as _objectSpread2 } from './_virtual/_rollupPluginBabelHelpers.js';
5
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
6
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
7
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
8
7
  import './FilteredList.css';
9
8
  import React from 'react';
9
+ import ReactCreateElement from './ReactCreateElement.js';
10
10
  import Scrollable from './Scrollable.js';
11
- import { UNDEFINED, orNoop, classNames, ref, isFunction, stopPropagation, isObject } from './Tools.js';
11
+ import { orNoop, classNames, ref, isFunction, stopPropagation, isObject } from './Tools.js';
12
12
  import { PureComponent } from './ReactConstants.js';
13
13
 
14
- var getLabel = function (labels, id) { return isFunction(labels) ? labels(id) : (labels ? labels[id] : id); };
15
- var FilteredList = /** @class */ (function (_super) {
16
- __inherits(FilteredList, _super);
17
- function FilteredList(props) {
18
- var _this = _super.call(this, props) || this;
19
- _this.hidden = {};
20
- _this.list = [];
21
- _this.elements = {};
22
- _this.el = null;
23
- _this.updateList = function (props) {
24
- var data = __data(props);
25
- var selected = __state(_this).selected;
26
- _this.list = data || [];
27
- if (!_this.list.includes(selected))
28
- _this.setState({ selected: -1 });
29
- };
30
- _this.onSelect = function (id) {
31
- _this.setState({ selected: id });
32
- __props(_this).onSelect(id);
33
- };
34
- _this.selected = function () {
35
- var value = __state(_this).selected;
36
- var selectSingle = __props(_this).selectSingle;
37
- if (value === -1 || _this.hidden[value + '']) {
38
- var filtered = _this.list.filter(function (id) { return !_this.hidden[id]; });
39
- if ((selectSingle === UNDEFINED || selectSingle) && __length(filtered) === 1)
40
- return filtered[0];
41
- return null;
42
- }
43
- else {
44
- return value;
45
- }
46
- };
47
- _this.next = function () {
48
- var list = _this.list;
49
- var selected = __state(_this).selected;
50
- var position = list.findIndex(function (id) { return selected === id; });
51
- if (_this.hidden[list[position]])
52
- position = -1;
53
- while (++position < __length(list)) {
54
- if (!_this.hidden[list[position]])
55
- break;
56
- }
57
- if (position < __length(list)) {
58
- var id = list[position];
59
- _this.setState({ selected: id });
60
- _this.updateScroll(id);
61
- }
62
- };
63
- _this.prev = function () {
64
- var list = _this.list;
65
- var selected = __state(_this).selected;
66
- var position = list.findIndex(function (id) { return selected === id; });
67
- if (_this.hidden[list[position]])
68
- position = __length(list);
69
- while (--position >= 0) {
70
- if (!_this.hidden[list[position]])
71
- break;
72
- }
73
- if (position >= 0) {
74
- var id = list[position];
75
- _this.setState({ selected: id });
76
- _this.updateScroll(id);
77
- }
78
- };
79
- _this.updateScroll = function (id) {
80
- var child = _this.elements[id];
81
- var container = _this.el;
82
- var scrollTop = container.getScroll();
83
- var height = container.getHeight();
84
- var isVisible = scrollTop <= child.offsetTop && scrollTop + height >= child.offsetTop + __clientHeight(child);
85
- if (!isVisible) {
86
- var scrollToBottom = child.offsetTop + __clientHeight(child) - height;
87
- var scrollToTop = child.offsetTop;
88
- if (Math.abs(scrollTop - scrollToTop) < Math.abs(scrollTop - scrollToBottom)) {
89
- container.setScroll(scrollToTop);
90
- }
91
- else {
92
- container.setScroll(scrollToBottom);
93
- }
94
- }
95
- };
96
- _this.reset = function () {
97
- _this.setState({ selected: -1 });
98
- _this.el.scrollTop = 0;
99
- };
100
- _this.scrollTo = function (id) { return _this.el.setScroll(_this.elements[id] && _this.elements[id].offsetTop); };
101
- _this.state = { selected: -1 };
102
- return _this;
103
- }
104
- FilteredList.prototype[ReactConstants[0]] = function () {
105
- orNoop(__props(this).nextProvider)(this.next);
106
- orNoop(__props(this).prevProvider)(this.prev);
107
- orNoop(__props(this).selectedProvider)(this.selected);
108
- orNoop(__props(this).resetProvider)(this.reset);
109
- this.updateList(__props(this));
14
+ var getLabel = function getLabel(labels, id) {
15
+ return isFunction(labels) ? labels(id) : labels[id];
16
+ };
17
+ var FilteredList = function (_PureComponent) {
18
+ _inherits(FilteredList, _PureComponent);
19
+ var _super = _createSuper(FilteredList);
20
+ function FilteredList(_props) {
21
+ var _this;
22
+ _classCallCheck(this, FilteredList);
23
+ _this = _super.call(this, _props);
24
+ _this.updateList = function (props) {
25
+ var data = __data(props);
26
+ var selected = __state(_this).selected;
27
+ _this.list = data || [];
28
+ if (!_this.list.includes(selected)) _this.setState({
29
+ selected: -1
30
+ });
110
31
  };
111
- FilteredList.prototype[ReactConstants[2]] = function (prevProps, prevState, snapshot) {
112
- if (__props(this).data === __data(prevProps))
113
- return;
114
- this.updateList(__props(this));
32
+ _this.onSelect = function (id) {
33
+ _this.setState({
34
+ selected: id
35
+ });
36
+ __props(_this).onSelect(id);
115
37
  };
116
- FilteredList.prototype[ReactConstants[3]] = function () {
117
- var _this = this;
118
- var _a = __props(this), data = __data(_a), labels = _a.labels, filter = _a.filter, className = _a[ReactConstants[5]], selected = _a.selected, inline = _a.inline, childComponent = _a.childComponent, childProps = _a.childProps, style = __style(_a), scroll = _a.scroll;
119
- return (jsxRuntime_2(Scrollable, __extends({ [ReactConstants[5]]: classNames('FilteredList', className, inline ? 'inline' : 'popup'), ref: ref('el', this), style: style, scrollBarMode: scroll }, { [ReactConstants[4]]: (data || []).filter(function (id) { return id !== false && id != null; }).map(function (id) {
120
- var key = '' + id;
121
- return jsxRuntime_2(ItemWrapper, { id: id, label: getLabel(labels, id), childComponent: childComponent, childProps: childProps, element: function (el) { return _this.elements[key] = el; }, [ReactConstants[6]]: function (e) {
122
- stopPropagation(e);
123
- _this.onSelect(id);
124
- }, onMouseEnter: function (e) { return _this.setState({ selected: id }); }, onMouseLeave: function (e) { return id === __state(_this).selected && _this.setState({ selected: -1 }); }, [ReactConstants[5]]: classNames('child', __state(_this).selected === id && 'active', selected === id || (selected && isObject(selected) && selected[key]) && 'selected'), classProvider: function (it) { return (_this.hidden[key] = !(!filter || filter(it))) && 'hidden'; } }, key);
125
- }) })));
38
+ _this.selected = function () {
39
+ var value = __state(_this).selected;
40
+ var selectSingle = __props(_this).selectSingle;
41
+ if (value === -1 || _this.hidden[value]) {
42
+ var filtered = _this.list.filter(function (id) {
43
+ return !_this.hidden[id];
44
+ });
45
+ if (selectSingle && __length(filtered) === 1) return filtered[0];
46
+ return null;
47
+ } else {
48
+ return value;
49
+ }
126
50
  };
127
- return FilteredList;
128
- }(PureComponent));
129
- var ItemWrapper = /** @class */ (function (_super) {
130
- __inherits(ItemWrapper, _super);
131
- function ItemWrapper() {
132
- var _this = _super !== null && _super.apply(this, arguments) || this;
133
- _this.el = null;
134
- _this.data = null;
135
- return _this;
136
- }
137
- ItemWrapper.prototype[ReactConstants[3]] = function () {
138
- var _this = this;
139
- var _a = __props(this), id = _a.id, label = _a.label, onClick = _a[ReactConstants[6]], onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, classProvider = _a.classProvider, className = _a[ReactConstants[5]], childComponent = _a.childComponent, childProps = _a.childProps;
140
- var child = React.createElement(childComponent, __extends(__extends({}, childProps), { id: id, label: label, dataConsumer: function (data) { return _this.data = data; } }));
141
- var cssClass = orNoop(classProvider)(__data(this));
142
- return (jsxRuntime_2("div", __extends({ [ReactConstants[5]]: classNames('ItemWrapper', cssClass, className), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave,
143
- // onMouseDown={onMouseDown}
144
- [ReactConstants[6]]: onClick, ref: ref('el', this) }, { [ReactConstants[4]]: child })));
51
+ _this.next = function () {
52
+ var list = _this.list;
53
+ var selected = __state(_this).selected;
54
+ var position = list.findIndex(function (id) {
55
+ return selected === id;
56
+ });
57
+ if (_this.hidden[list[position]]) position = -1;
58
+ while (++position < __length(list)) {
59
+ if (!_this.hidden[list[position]]) break;
60
+ }
61
+ if (position < __length(list)) {
62
+ var id = list[position];
63
+ _this.setState({
64
+ selected: id
65
+ });
66
+ _this.updateScroll(id);
67
+ }
68
+ };
69
+ _this.prev = function () {
70
+ var list = _this.list;
71
+ var selected = __state(_this).selected;
72
+ var position = list.findIndex(function (id) {
73
+ return selected === id;
74
+ });
75
+ if (_this.hidden[list[position]]) position = __length(list);
76
+ while (--position >= 0) {
77
+ if (!_this.hidden[list[position]]) break;
78
+ }
79
+ if (position >= 0) {
80
+ var id = list[position];
81
+ _this.setState({
82
+ selected: id
83
+ });
84
+ _this.updateScroll(id);
85
+ }
86
+ };
87
+ _this.updateScroll = function (id) {
88
+ var child = _this.elements[id];
89
+ var container = _this.el;
90
+ var scrollTop = container.getScroll();
91
+ var height = container.getHeight();
92
+ var isVisible = scrollTop <= child.offsetTop && scrollTop + height >= child.offsetTop + __clientHeight(child);
93
+ if (!isVisible) {
94
+ var scrollToBottom = child.offsetTop + __clientHeight(child) - height;
95
+ var scrollToTop = child.offsetTop;
96
+ if (Math.abs(scrollTop - scrollToTop) < Math.abs(scrollTop - scrollToBottom)) {
97
+ container.setScroll(scrollToTop);
98
+ } else {
99
+ container.setScroll(scrollToBottom);
100
+ }
101
+ }
102
+ };
103
+ _this.reset = function () {
104
+ _this.setState({
105
+ selected: -1
106
+ });
107
+ _this.el.scrollTop = 0;
145
108
  };
146
- ItemWrapper.prototype[ReactConstants[0]] = function () {
147
- orNoop(__props(this).element)(this.el);
148
- this.forceUpdate();
109
+ _this.scrollTo = function (id) {
110
+ return _this.el.setScroll(_this.elements[id] && _this.elements[id].offsetTop);
149
111
  };
150
- return ItemWrapper;
151
- }(React.Component));
112
+ _this.state = {
113
+ selected: -1
114
+ };
115
+ _this.hidden = {};
116
+ _this.elements = {};
117
+ return _this;
118
+ }
119
+ _createClass(FilteredList, [{
120
+ key: [ReactConstants[0]],
121
+ value: function componentDidMount() {
122
+ orNoop(__props(this).nextProvider)(this.next);
123
+ orNoop(__props(this).prevProvider)(this.prev);
124
+ orNoop(__props(this).selectedProvider)(this.selected);
125
+ orNoop(__props(this).resetProvider)(this.reset);
126
+ this.updateList(__props(this));
127
+ }
128
+ }, {
129
+ key: [ReactConstants[2]],
130
+ value: function componentDidUpdate(prevProps, prevState, snapshot) {
131
+ if (__props(this).data === __data(prevProps)) return;
132
+ this.updateList(__props(this));
133
+ }
134
+ }, {
135
+ key: [ReactConstants[3]],
136
+ value: function render() {
137
+ var _this2 = this;
138
+ var _this$props = __props(this),
139
+ data = __data(_this$props),
140
+ labels = _this$props.labels,
141
+ filter = _this$props.filter,
142
+ className = _this$props[ReactConstants[5]],
143
+ selected = _this$props.selected,
144
+ inline = _this$props.inline,
145
+ childComponent = _this$props.childComponent,
146
+ childProps = _this$props.childProps,
147
+ style = __style(_this$props),
148
+ scroll = _this$props.scroll;
149
+ return ReactCreateElement(Scrollable, {
150
+ [ReactConstants[5]]: classNames('FilteredList', className, inline ? 'inline' : 'popup'),
151
+ ref: ref('el', this),
152
+ style: style,
153
+ scrollBarMode: scroll
154
+ }, (data || []).filter(function (id) {
155
+ return id !== false && id != null;
156
+ }).map(function (id) {
157
+ return ReactCreateElement(ItemWrapper, {
158
+ id: id,
159
+ key: id,
160
+ label: getLabel(labels, id),
161
+ childComponent: childComponent,
162
+ childProps: childProps,
163
+ element: function element(el) {
164
+ return _this2.elements[id] = el;
165
+ },
166
+ [ReactConstants[6]]: function onClick(e) {
167
+ stopPropagation(e);
168
+ _this2.onSelect(id);
169
+ },
170
+ onMouseEnter: function onMouseEnter(e) {
171
+ return _this2.setState({
172
+ selected: id
173
+ });
174
+ },
175
+ onMouseLeave: function onMouseLeave(e) {
176
+ return id === __state(_this2).selected && _this2.setState({
177
+ selected: -1
178
+ });
179
+ },
180
+ [ReactConstants[5]]: classNames('child', __state(_this2).selected === id && 'active', selected === id || isObject(selected) && selected[id] && 'selected'),
181
+ classProvider: function classProvider(it) {
182
+ return (_this2.hidden[id] = !filter(it)) && 'hidden';
183
+ }
184
+ });
185
+ }));
186
+ }
187
+ }]);
188
+ return FilteredList;
189
+ }(PureComponent);
190
+ FilteredList.defaultProps = {
191
+ data: [],
192
+ labels: {},
193
+ selected: {},
194
+ inline: false,
195
+ selectSingle: true,
196
+ filter: function filter() {
197
+ return true;
198
+ }
199
+ };
200
+ var FilteredList$1 = FilteredList;
201
+ var ItemWrapper = function (_React$Component) {
202
+ _inherits(ItemWrapper, _React$Component);
203
+ var _super2 = _createSuper(ItemWrapper);
204
+ function ItemWrapper() {
205
+ _classCallCheck(this, ItemWrapper);
206
+ return _super2.apply(this, arguments);
207
+ }
208
+ _createClass(ItemWrapper, [{
209
+ key: [ReactConstants[3]],
210
+ value: function render() {
211
+ var _this3 = this;
212
+ var _this$props2 = __props(this),
213
+ id = _this$props2.id,
214
+ label = _this$props2.label,
215
+ onClick = _this$props2[ReactConstants[6]],
216
+ onMouseDown = _this$props2.onMouseDown,
217
+ onMouseEnter = _this$props2.onMouseEnter,
218
+ onMouseLeave = _this$props2.onMouseLeave,
219
+ classProvider = _this$props2.classProvider,
220
+ className = _this$props2[ReactConstants[5]],
221
+ childComponent = _this$props2.childComponent,
222
+ childProps = _this$props2.childProps;
223
+ var child = React.createElement(childComponent, _objectSpread2(_objectSpread2({}, childProps), {}, {
224
+ id: id,
225
+ label: label,
226
+ dataConsumer: function dataConsumer(data) {
227
+ return _this3.data = data;
228
+ }
229
+ }));
230
+ var cssClass = orNoop(classProvider)(__data(this));
231
+ return ReactCreateElement("div", {
232
+ [ReactConstants[5]]: classNames('ItemWrapper', cssClass, className),
233
+ onMouseEnter: onMouseEnter,
234
+ onMouseLeave: onMouseLeave,
235
+ onMouseDown: onMouseDown,
236
+ [ReactConstants[6]]: onClick,
237
+ ref: ref('el', this)
238
+ }, child);
239
+ }
240
+ }, {
241
+ key: [ReactConstants[0]],
242
+ value: function componentDidMount() {
243
+ orNoop(__props(this).element)(this.el);
244
+ this.forceUpdate();
245
+ }
246
+ }]);
247
+ return ItemWrapper;
248
+ }(React.Component);
152
249
 
153
- export { FilteredList as default, getLabel };
250
+ export { FilteredList$1 as default, getLabel };
154
251
  //# sourceMappingURL=FilteredList.js.map
package/ImageGallery.js CHANGED
@@ -789,8 +789,10 @@ var ImageGalleryContainer = function (_React$Component2) {
789
789
  };
790
790
  var dispatch = function dispatch(action) {
791
791
  return setTimeout(function () {
792
- var state = IMAGE_GALLERY_REDUCER(__state(that), action);
793
- if (state !== __state(that)) that.setState(state);
792
+ that.setState(function (state) {
793
+ state = IMAGE_GALLERY_REDUCER(state, action);
794
+ return state;
795
+ });
794
796
  }, 0);
795
797
  };
796
798
  var props = propsGetter(that);
package/Tools.d.ts CHANGED
@@ -12,11 +12,12 @@ export declare const allPropsExcept: (obj: any, except: any) => {};
12
12
  export declare const continuousIncludes: (value: any, inc: any) => boolean;
13
13
  export declare const debounce: (func: any, delay: any) => () => void;
14
14
  export declare const memo: (func: any) => () => any;
15
+ export declare const constructorOf: (v: any) => any;
15
16
  export declare const typeOf: (v: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
16
17
  export declare const isFunction: (v: any) => boolean;
17
18
  export declare const isString: (v: any) => boolean;
18
19
  export declare const isObject: (v: any) => boolean;
19
- export declare const isDifferent: (a: any, b: any) => any;
20
+ export declare const isDifferent: (a: any, b: any) => boolean;
20
21
  export declare const preventDefault: (e: any) => void;
21
22
  export declare const stopPropagation: (e: any) => void;
22
23
  export declare const setTimeout: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => any;
package/Tools.js CHANGED
@@ -36,7 +36,7 @@ var createAccessor = function (field) { return function (o, value) {
36
36
  return !o ? null : value != UNDEFINED ? o[field] = value : o[field];
37
37
  }; };
38
38
  var setOf = function (list) { return (list || []).reduce(function (map, key) {
39
- map[key] = true;
39
+ map[key] = TRUE;
40
40
  return map;
41
41
  }, {}); };
42
42
  var allPropsExcept = function (obj, except) {
@@ -53,20 +53,19 @@ var continuousIncludes = function (value, inc) {
53
53
  for (var i = 0; i < length; i++) {
54
54
  from = value.indexOf(inc[i], from + 1);
55
55
  if (from === -1)
56
- return false;
56
+ return FALSE;
57
57
  }
58
- return true;
58
+ return TRUE;
59
59
  };
60
60
  var isArrayShallowEqual = function (a, b) {
61
61
  if (a === b)
62
- return true;
62
+ return TRUE;
63
63
  if (a == null || b == null)
64
- return false;
65
- if (__length(a) !== __length(b)) {
66
- return false;
67
- }
64
+ return FALSE;
65
+ if (__length(a) !== __length(b))
66
+ return FALSE;
68
67
  var i = __length(a) - 1;
69
- var result = true;
68
+ var result = TRUE;
70
69
  while (i >= 0 && (result = (a[i] === b[i]))) {
71
70
  i--;
72
71
  }
@@ -96,47 +95,42 @@ var memo = function (func) {
96
95
  return prevResult;
97
96
  };
98
97
  };
98
+ var constructorOf = function (v) { return v && v.constructor; };
99
99
  var typeOf = function (v) { return typeof v; };
100
100
  var isFunction = function (v) { return typeOf(v) === 'function'; };
101
101
  var isString = function (v) { return typeOf(v) === 'string'; };
102
102
  var isObject = function (v) { return typeOf(v) === 'object'; };
103
+ var FALSE = false;
104
+ var TRUE = true;
103
105
  var isDifferent = function (a, b) {
104
- if (a == null && b == null)
105
- return false;
106
- if (a == null || b == null)
107
- return true;
106
+ if (a === null && b === null)
107
+ return FALSE;
108
+ if (a === null || b === null)
109
+ return TRUE;
108
110
  if (a === b)
109
- return false;
110
- var typeA = typeOf(a);
111
- var typeB = typeOf(b);
112
- if (typeA !== typeB) {
113
- return true;
111
+ return FALSE;
112
+ var constructorA = constructorOf(a);
113
+ var constructorB = constructorOf(b);
114
+ if (constructorA !== constructorB) {
115
+ return TRUE;
114
116
  }
115
- if (Array.isArray(a)) {
116
- if (__length(a) !== __length(b)) {
117
- return true;
118
- }
119
- var i = __length(a) - 1;
120
- var result = false;
121
- while (i >= 0 && !(result = isDifferent(a[i], b[i]))) {
122
- i--;
117
+ var i;
118
+ if (constructorA === Array) {
119
+ if ((i = __length(a)) === __length(b)) {
120
+ while (i-- && !isDifferent(a[i], b[i])) {
121
+ }
123
122
  }
124
- return result;
125
123
  }
126
- if (typeA === 'object') {
124
+ else if (constructorA === Object) {
127
125
  var keysA = Object.keys(a);
128
126
  var keysB = Object.keys(b);
129
- if (__length(keysA) !== __length(keysB)) {
130
- return true;
131
- }
132
- var j = __length(keysA) - 1;
133
- var r = false;
134
- while (j >= 0 && !(r = keysA[j] !== keysB[j]) && !(r = isDifferent(a[keysA[j]], b[keysB[j]]))) {
135
- j--;
127
+ if ((i = __length(keysA)) === __length(keysB)) {
128
+ var key = void 0;
129
+ while (i-- && ((key = keysA[i]) in b) && !isDifferent(a[key], b[key])) {
130
+ }
136
131
  }
137
- return r;
138
132
  }
139
- return true;
133
+ return i !== -1;
140
134
  };
141
135
  var preventDefault = function (e) {
142
136
  e && e.preventDefault();
@@ -232,5 +226,5 @@ if (process.env.NODE_ENV !== 'production') {
232
226
  };
233
227
  }
234
228
 
235
- export { Comparators, DOCUMENT, NOOP, UNDEFINED, WINDOW, addEventListener, allPropsExcept, classNames, clearInterval, clearTimeout, continuousIncludes, createAccessor, createRef, debounce, getRandomId, isDifferent, isFunction, isObject, isString, isUndefined, memo, orNoop, preventDefault, ref, removeEventListener, requestAnimationFrame, setInterval, setOf, setTimeout, stopPropagation, typeOf };
229
+ export { Comparators, DOCUMENT, NOOP, UNDEFINED, WINDOW, addEventListener, allPropsExcept, classNames, clearInterval, clearTimeout, constructorOf, continuousIncludes, createAccessor, createRef, debounce, getRandomId, isDifferent, isFunction, isObject, isString, isUndefined, memo, orNoop, preventDefault, ref, removeEventListener, requestAnimationFrame, setInterval, setOf, setTimeout, stopPropagation, typeOf };
236
230
  //# sourceMappingURL=Tools.js.map