react-ui-basics 0.0.159 → 0.0.162
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.
- package/Animated.js +11 -10
- package/AutocompleteSelect.js +76 -77
- package/Button.js +24 -25
- package/Checkbox.js +10 -11
- package/CircleProgress.js +5 -6
- package/CommonFields.js +23 -16
- package/DNDContainer.js +47 -48
- package/DNDDraggable.js +9 -10
- package/DNDDroppable.js +8 -9
- package/Dialog.js +18 -19
- package/DropFileInput.js +4 -5
- package/DroppableHorizontalList.js +26 -27
- package/DroppableList.js +26 -27
- package/Dropzone.js +19 -20
- package/FilteredList.js +43 -44
- package/FloatingActionButton.js +6 -7
- package/FormUploadProgress.js +9 -10
- package/ImageGallery.js +125 -126
- package/MaterialIcon.js +5 -6
- package/Modal.js +19 -20
- package/ModalMenu.js +12 -13
- package/ReactConstants.d.ts +5 -4
- package/ReactConstants.js +6 -3
- package/ReactCreateElement.js +2 -1
- package/ReadyListener.js +10 -11
- package/Scrollable.js +52 -53
- package/ScrollableTable.js +4 -5
- package/Size.js +5 -6
- package/Snackbar.js +7 -8
- package/SpinningProgress.js +5 -6
- package/Switch.js +20 -21
- package/Table.d.ts +0 -1
- package/Table.js +50 -57
- package/TextField.js +24 -25
- package/Tools.d.ts +1 -0
- package/Tools.js +14 -13
- package/_virtual/_commonjsHelpers.js +2 -1
- package/_virtual/_react.js +2 -1
- package/_virtual/react-jsx-runtime.development.js +2 -1
- package/bundle.css +784 -784
- package/index.js +8 -7
- package/package.json +1 -1
- package/router/HistoryTools.js +2 -1
- package/router/Link.js +6 -7
- package/router/NavLink.js +5 -6
- package/router/Route.js +15 -16
- package/router/index.js +2 -3
- package/store/ProxyTools.js +2 -3
- package/store/Store.js +2 -3
- package/Animated.js.map +0 -1
- package/AutocompleteSelect.js.map +0 -1
- package/Button.js.map +0 -1
- package/Checkbox.js.map +0 -1
- package/CircleProgress.js.map +0 -1
- package/CommonFields.js.map +0 -1
- package/DNDContainer.js.map +0 -1
- package/DNDDraggable.js.map +0 -1
- package/DNDDroppable.js.map +0 -1
- package/Dialog.js.map +0 -1
- package/DropFileInput.js.map +0 -1
- package/DroppableHorizontalList.js.map +0 -1
- package/DroppableList.js.map +0 -1
- package/Dropzone.js.map +0 -1
- package/FilteredList.js.map +0 -1
- package/FloatingActionButton.js.map +0 -1
- package/FormUploadProgress.js.map +0 -1
- package/ImageGallery.js.map +0 -1
- package/MaterialIcon.js.map +0 -1
- package/Modal.js.map +0 -1
- package/ModalMenu.js.map +0 -1
- package/ReactConstants.js.map +0 -1
- package/ReactCreateElement.js.map +0 -1
- package/ReadyListener.js.map +0 -1
- package/Scrollable.js.map +0 -1
- package/ScrollableTable.js.map +0 -1
- package/Size.js.map +0 -1
- package/Snackbar.js.map +0 -1
- package/SpinningProgress.js.map +0 -1
- package/Switch.js.map +0 -1
- package/Table.js.map +0 -1
- package/TextField.js.map +0 -1
- package/Tools.js.map +0 -1
- package/index.js.map +0 -1
package/Animated.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
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";
|
|
2
3
|
import { inherits as _inherits, createSuper as _createSuper, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, objectSpread2 as _objectSpread2 } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
3
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import React from 'react';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
10
9
|
import { setOf, clearTimeout, allPropsExcept, classNames, requestAnimationFrame, setTimeout } from './Tools.js';
|
|
@@ -76,14 +75,14 @@ var Animated = function (_PureComponent) {
|
|
|
76
75
|
_this = _super.call(this, properties);
|
|
77
76
|
var that = _assertThisInitialized(_this);
|
|
78
77
|
that.state = animatedState(!!properties[value]);
|
|
79
|
-
that[
|
|
78
|
+
that[ReactConstants[0]] = function () {
|
|
80
79
|
var _props = props(that);
|
|
81
80
|
if (!!_props[value]) processMounting(that, _props[mounting], _props[mountingDelay]);
|
|
82
81
|
};
|
|
83
|
-
that[
|
|
82
|
+
that[ReactConstants[1]] = function () {
|
|
84
83
|
clearTimer(that);
|
|
85
84
|
};
|
|
86
|
-
that[
|
|
85
|
+
that[ReactConstants[3]] = function () {
|
|
87
86
|
var _state = state(that);
|
|
88
87
|
if (!_state[enabled]) return null;
|
|
89
88
|
var _props = props(that),
|
|
@@ -94,13 +93,15 @@ var Animated = function (_PureComponent) {
|
|
|
94
93
|
var childStyles = styles["default"];
|
|
95
94
|
if (isMounting) childStyles = styles[mounting];else if (isUnMounting) childStyles = styles[unmounting];else if (isMounted) childStyles = styles[mounted] || styles[mounting];
|
|
96
95
|
var otherProps = allPropsExcept(_props, selfProps);
|
|
97
|
-
return React.Children.map(_props[
|
|
96
|
+
return React.Children.map(_props[ReactConstants[4]], function (child) {
|
|
98
97
|
var _objectSpread2$1;
|
|
99
|
-
return child && React.cloneElement(child, _objectSpread2((_objectSpread2$1 = {}, _defineProperty(_objectSpread2$1, className, classNames(props(child)[
|
|
98
|
+
return child && React.cloneElement(child, _objectSpread2((_objectSpread2$1 = {}, _defineProperty(_objectSpread2$1, className, classNames(props(child)[ReactConstants[5]], _props[ReactConstants[5]], isMounting && mounting, isMounted && mounted, isUnMounting && unmounting)), _defineProperty(_objectSpread2$1, "style", _objectSpread2(_objectSpread2({}, __style(props(child))), childStyles)), _objectSpread2$1), otherProps));
|
|
100
99
|
});
|
|
101
100
|
};
|
|
102
|
-
that[
|
|
103
|
-
var
|
|
101
|
+
that[ReactConstants[2]] = function () {
|
|
102
|
+
var p = props;
|
|
103
|
+
var t = that;
|
|
104
|
+
var _props = p(t) || props(that),
|
|
104
105
|
_state = state(that),
|
|
105
106
|
v = _props[value],
|
|
106
107
|
mountingDuration = _props[mounting],
|
package/AutocompleteSelect.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
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";
|
|
2
3
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, objectSpread2 as _objectSpread2, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass, toConsumableArray as _toConsumableArray } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
3
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import React from 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import PropTypes from 'prop-types';
|
|
@@ -27,11 +26,11 @@ var DummyChild = function DummyChild(_ref) {
|
|
|
27
26
|
var id = _ref.id,
|
|
28
27
|
label = _ref.label,
|
|
29
28
|
dataConsumer = _ref.dataConsumer,
|
|
30
|
-
onClick = _ref
|
|
29
|
+
onClick = _ref[ReactConstants[6]];
|
|
31
30
|
orNoop(dataConsumer)(label || id);
|
|
32
31
|
return ReactCreateElement("div", {
|
|
33
|
-
[
|
|
34
|
-
|
|
32
|
+
[ReactConstants[5]]: "DummyChild",
|
|
33
|
+
[ReactConstants[6]]: onClick
|
|
35
34
|
}, label || id);
|
|
36
35
|
};
|
|
37
36
|
var prepareSelected = function prepareSelected(value) {
|
|
@@ -68,7 +67,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
68
67
|
_classCallCheck(this, AutocompleteSelect);
|
|
69
68
|
_this = _super.call(this, props);
|
|
70
69
|
_this.initSelected = function (_ref2, _ref3) {
|
|
71
|
-
var value = _ref2
|
|
70
|
+
var value = __value(_ref2),
|
|
72
71
|
mode = _ref2.mode,
|
|
73
72
|
allowCustom = _ref2.allowCustom;
|
|
74
73
|
var _ref3$filterValue = _ref3.filterValue,
|
|
@@ -89,10 +88,10 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
89
88
|
};
|
|
90
89
|
});
|
|
91
90
|
_this.onClickOutside = function () {
|
|
92
|
-
var _this$props = _this
|
|
91
|
+
var _this$props = __props(_this),
|
|
93
92
|
allowCustom = _this$props.allowCustom,
|
|
94
93
|
required = _this$props.required;
|
|
95
|
-
var filterValue = _this.
|
|
94
|
+
var filterValue = __state(_this).filterValue;
|
|
96
95
|
if (allowCustom && (!!filterValue || !required)) {
|
|
97
96
|
_this.onSelect();
|
|
98
97
|
}
|
|
@@ -102,17 +101,17 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
102
101
|
_this.onCancel();
|
|
103
102
|
};
|
|
104
103
|
_this.onCancel = function () {
|
|
105
|
-
orNoop(_this.
|
|
104
|
+
orNoop(__props(_this).onCancel)();
|
|
106
105
|
};
|
|
107
106
|
_this.onSelect = function (selectedId) {
|
|
108
|
-
var _this$props2 = _this
|
|
107
|
+
var _this$props2 = __props(_this),
|
|
109
108
|
mode = _this$props2.mode,
|
|
110
109
|
required = _this$props2.required,
|
|
111
110
|
allowCustom = _this$props2.allowCustom,
|
|
112
111
|
onSelect = _this$props2.onSelect,
|
|
113
|
-
onChange = _this$props2
|
|
112
|
+
onChange = _this$props2[ReactConstants[7]],
|
|
114
113
|
defaultValue = _this$props2["default"];
|
|
115
|
-
var _this$state = _this
|
|
114
|
+
var _this$state = __state(_this),
|
|
116
115
|
filterValue = _this$state.filterValue,
|
|
117
116
|
currentSelection = _this$state.selected;
|
|
118
117
|
if (selectedId == null && (!!filterValue || !required) && allowCustom && (!_this.input || !_this.input.check())) selectedId = filterValue.trim();
|
|
@@ -124,7 +123,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
124
123
|
var selected = _objectSpread2({}, currentSelection);
|
|
125
124
|
if (selected[selectedId] && (defaultValue || isMultiSelect)) {
|
|
126
125
|
delete selected[selectedId];
|
|
127
|
-
if (defaultValue && Object.keys(selected)
|
|
126
|
+
if (defaultValue && Object.keys(selected).length === 0) selected[defaultValue] = defaultValue;
|
|
128
127
|
} else if (isSelected && isMultiSelect) {
|
|
129
128
|
selected[selectedId] = selectedId;
|
|
130
129
|
} else if (isSelected) {
|
|
@@ -150,33 +149,33 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
150
149
|
selected: {},
|
|
151
150
|
filterValue: ''
|
|
152
151
|
});
|
|
153
|
-
orNoop(_this.
|
|
154
|
-
orNoop(_this
|
|
155
|
-
_this.initSelected(_this
|
|
152
|
+
orNoop(__props(_this).onSelect)(null);
|
|
153
|
+
orNoop(__props(_this)[ReactConstants[7]])([]);
|
|
154
|
+
_this.initSelected(__props(_this), __state(_this));
|
|
156
155
|
};
|
|
157
156
|
_this.remove = function (id) {
|
|
158
|
-
var result = _objectSpread2(_objectSpread2({}, _this
|
|
159
|
-
selected: _objectSpread2({}, _this.
|
|
157
|
+
var result = _objectSpread2(_objectSpread2({}, __state(_this)), {}, {
|
|
158
|
+
selected: _objectSpread2({}, __state(_this).selected),
|
|
160
159
|
filterValue: ''
|
|
161
160
|
});
|
|
162
161
|
delete result.selected[id];
|
|
163
162
|
_this.setState(result);
|
|
164
|
-
orNoop(_this
|
|
163
|
+
orNoop(__props(_this)[ReactConstants[7]])(Object.values(result.selected));
|
|
165
164
|
};
|
|
166
|
-
_this
|
|
167
|
-
var value = event.
|
|
165
|
+
_this[ReactConstants[7]] = function (event) {
|
|
166
|
+
var value = __target(event).value;
|
|
168
167
|
_this.setState({
|
|
169
168
|
filterValue: value
|
|
170
169
|
});
|
|
171
|
-
_this.
|
|
170
|
+
__props(_this).onFilterInputChange == null ? void 0 : __props(_this).onFilterInputChange(value);
|
|
172
171
|
};
|
|
173
172
|
var that = _assertThisInitialized(_this);
|
|
174
173
|
that.state = {
|
|
175
|
-
selected: prepareSelected(props
|
|
174
|
+
selected: prepareSelected(__value(props)),
|
|
176
175
|
isActive: !!props.focused
|
|
177
176
|
};
|
|
178
177
|
that.randomId = getRandomId('acs-');
|
|
179
|
-
var data = props
|
|
178
|
+
var data = __data(props),
|
|
180
179
|
getSelected = props.getSelected;
|
|
181
180
|
isFunction(data) && data(function (data) {
|
|
182
181
|
return that.setState({
|
|
@@ -184,48 +183,48 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
184
183
|
});
|
|
185
184
|
});
|
|
186
185
|
getSelected && getSelected(function () {
|
|
187
|
-
return Object.values(that.
|
|
186
|
+
return Object.values(__state(that).selected);
|
|
188
187
|
});
|
|
189
188
|
return _this;
|
|
190
189
|
}
|
|
191
190
|
_createClass(AutocompleteSelect, [{
|
|
192
|
-
key:
|
|
191
|
+
key: [ReactConstants[0]],
|
|
193
192
|
value: function componentDidMount() {
|
|
194
193
|
var _this2 = this;
|
|
195
194
|
addEventListener(DOCUMENT, 'mousedown', this.listener = function (e) {
|
|
196
|
-
if (_this2.
|
|
195
|
+
if (__state(_this2).isActive && _this2.el && !_this2.el.contains(__target(e))) {
|
|
197
196
|
_this2.onClickOutside();
|
|
198
197
|
}
|
|
199
198
|
});
|
|
200
|
-
if (this.
|
|
199
|
+
if (__props(this).required) {
|
|
201
200
|
var form = findParent(this.el.parentNode, 'form');
|
|
202
201
|
if (form) {
|
|
203
202
|
addEventListener(this.submitButton = form.querySelector('button[type=submit]'), 'click', this.formSubmitListener = function (e) {
|
|
204
|
-
var errored = Object.keys(_this2.
|
|
203
|
+
var errored = Object.keys(__state(_this2).selected).length === 0;
|
|
205
204
|
_this2.setState({
|
|
206
205
|
errored: errored
|
|
207
206
|
});
|
|
208
207
|
});
|
|
209
208
|
}
|
|
210
209
|
}
|
|
211
|
-
this.initSelected(this
|
|
210
|
+
this.initSelected(__props(this), __state(this));
|
|
212
211
|
}
|
|
213
212
|
}, {
|
|
214
|
-
key:
|
|
213
|
+
key: [ReactConstants[2]],
|
|
215
214
|
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
|
216
|
-
if (this.
|
|
215
|
+
if (__props(this).value !== __value(prevProps)) this.initSelected(__props(this), __state(this));
|
|
217
216
|
}
|
|
218
217
|
}, {
|
|
219
|
-
key:
|
|
218
|
+
key: [ReactConstants[1]],
|
|
220
219
|
value: function componentWillUnmount() {
|
|
221
220
|
removeEventListener(DOCUMENT, 'mousedown', this.listener);
|
|
222
221
|
removeEventListener(this.submitButton, 'click', this.formSubmitListener);
|
|
223
222
|
}
|
|
224
223
|
}, {
|
|
225
|
-
key:
|
|
224
|
+
key: [ReactConstants[3]],
|
|
226
225
|
value: function render() {
|
|
227
226
|
var _this3 = this;
|
|
228
|
-
var _this$props3 = this
|
|
227
|
+
var _this$props3 = __props(this),
|
|
229
228
|
childComponent = _this$props3.childComponent,
|
|
230
229
|
childProps = _this$props3.childProps,
|
|
231
230
|
withArrow = _this$props3.withArrow,
|
|
@@ -237,44 +236,44 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
237
236
|
mode = _this$props3.mode,
|
|
238
237
|
selectedMode = _this$props3.selectedMode,
|
|
239
238
|
prefilter = _this$props3.prefilter,
|
|
240
|
-
className = _this$props3[
|
|
239
|
+
className = _this$props3[ReactConstants[5]],
|
|
241
240
|
scrollToValue = _this$props3.scrollToValue,
|
|
242
241
|
scroll = _this$props3.scroll,
|
|
243
242
|
required = _this$props3.required,
|
|
244
243
|
allowCustom = _this$props3.allowCustom,
|
|
245
244
|
inlineSelected = _this$props3.inlineSelected,
|
|
246
245
|
removeIcon = _this$props3.removeIcon;
|
|
247
|
-
var id = this.
|
|
248
|
-
var selectedComponent = this.
|
|
249
|
-
var _this$state2 = this
|
|
246
|
+
var id = __props(this).id || this.randomId;
|
|
247
|
+
var selectedComponent = __props(this).selectedComponent || childComponent;
|
|
248
|
+
var _this$state2 = __state(this),
|
|
250
249
|
_this$state2$selected = _this$state2.selected,
|
|
251
250
|
selected = _this$state2$selected === void 0 ? {} : _this$state2$selected,
|
|
252
251
|
_this$state2$filterVa = _this$state2.filterValue,
|
|
253
252
|
filterValue = _this$state2$filterVa === void 0 ? '' : _this$state2$filterVa,
|
|
254
253
|
errored = _this$state2.errored;
|
|
255
|
-
var isActive = this.
|
|
256
|
-
if (this.
|
|
257
|
-
isActive = this.
|
|
254
|
+
var isActive = __state(this).isActive;
|
|
255
|
+
if (__props(this).isActive !== UNDEFINED) {
|
|
256
|
+
isActive = __props(this).isActive;
|
|
258
257
|
}
|
|
259
|
-
var _this$props4 = this
|
|
260
|
-
_this$props4$data = _this$props4
|
|
258
|
+
var _this$props4 = __props(this),
|
|
259
|
+
_this$props4$data = __data(_this$props4),
|
|
261
260
|
data = _this$props4$data === void 0 ? [] : _this$props4$data,
|
|
262
261
|
_this$props4$labels = _this$props4.labels,
|
|
263
262
|
labels = _this$props4$labels === void 0 ? {} : _this$props4$labels;
|
|
264
|
-
if (this.
|
|
263
|
+
if (__state(this).data) data = __state(this).data;
|
|
265
264
|
if (!Array.isArray(data)) data = [];
|
|
266
265
|
var selectedIds = Object.values(selected);
|
|
267
|
-
var hasSelected = selectedIds
|
|
266
|
+
var hasSelected = __length(selectedIds) !== 0;
|
|
268
267
|
var setActive = function setActive(e) {
|
|
269
268
|
stopPropagation(e);
|
|
270
269
|
_this3.setState({
|
|
271
270
|
isActive: true
|
|
272
271
|
}, function () {
|
|
273
|
-
return scrollToValue && selectedIds
|
|
272
|
+
return scrollToValue && __length(selectedIds) > 0 && _this3.list.scrollTo(selectedIds[0]);
|
|
274
273
|
});
|
|
275
274
|
};
|
|
276
275
|
var toggle = function toggle(e) {
|
|
277
|
-
if (!_this3.
|
|
276
|
+
if (!__state(_this3).isActive) {
|
|
278
277
|
setActive(e);
|
|
279
278
|
} else {
|
|
280
279
|
stopPropagation(e);
|
|
@@ -291,32 +290,32 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
291
290
|
var filterFunction = this.createFilter(prefilter, filterValue, filterValueTrimmed.toLowerCase(), filter);
|
|
292
291
|
return ReactCreateElement("div", {
|
|
293
292
|
id: id,
|
|
294
|
-
[
|
|
293
|
+
[ReactConstants[5]]: classNames('AutocompleteSelect', mode, isMultipleSelect(mode) && 'multi', className, withFilter ? 'withFilter' : 'withoutFilter', isActive && 'active', errored && 'errored', inlineSelected && 'inlineSelected', hasSelected && 'hasSelected'),
|
|
295
294
|
ref: ref('el', this)
|
|
296
295
|
}, label && ReactCreateElement("label", {
|
|
297
|
-
[
|
|
296
|
+
[ReactConstants[5]]: classNames("label", (hasSelected || filterValue) && 'active', hasSelected && 'hasSelected'),
|
|
298
297
|
htmlFor: 'f-' + id,
|
|
299
|
-
|
|
298
|
+
[ReactConstants[6]]: function onClick() {
|
|
300
299
|
if (mode === MODE_MULTIPLE_MINI_INLINE || !isActive) {
|
|
301
300
|
toggle();
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
}, label, required && ' *', withArrow && ReactCreateElement("span", {
|
|
305
|
-
[
|
|
304
|
+
[ReactConstants[5]]: "arrow"
|
|
306
305
|
})), (!isActive || mode === MODE_MULTIPLE || mode === MODE_INLINE_MULTIPLE || mode === MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE_AUTO || !withFilter) && !inlineSelected && hasSelected && ReactCreateElement("div", {
|
|
307
|
-
[
|
|
308
|
-
|
|
306
|
+
[ReactConstants[5]]: classNames('selected', !label && 'nolabel', (mode === MODE_MULTIPLE_MINI || mode === MODE_MINI || mode === MODE_MULTIPLE_MINI_INLINE) && 'clickable', selectedMode),
|
|
307
|
+
[ReactConstants[6]]: toggle
|
|
309
308
|
}, selectedMode === 'full' && selectedIds.map(function (id) {
|
|
310
309
|
return ReactCreateElement("div", {
|
|
311
|
-
[
|
|
310
|
+
[ReactConstants[5]]: "value",
|
|
312
311
|
key: id
|
|
313
312
|
}, React.createElement(selectedComponent, _objectSpread2(_objectSpread2({}, childProps), {}, {
|
|
314
313
|
id: id,
|
|
315
314
|
label: getLabel(labels, id),
|
|
316
|
-
|
|
315
|
+
[ReactConstants[6]]: setActive
|
|
317
316
|
})), ReactCreateElement("div", {
|
|
318
|
-
[
|
|
319
|
-
|
|
317
|
+
[ReactConstants[5]]: "button remove",
|
|
318
|
+
[ReactConstants[6]]: function onClick(e) {
|
|
320
319
|
stopPropagation(e);
|
|
321
320
|
_this3.remove(id);
|
|
322
321
|
}
|
|
@@ -327,25 +326,25 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
327
326
|
}, React.createElement(selectedComponent, _objectSpread2(_objectSpread2({}, childProps), {}, {
|
|
328
327
|
id: id,
|
|
329
328
|
label: getLabel(labels, id),
|
|
330
|
-
|
|
331
|
-
})), id !== selectedIds[selectedIds
|
|
329
|
+
[ReactConstants[6]]: setActive
|
|
330
|
+
})), id !== selectedIds[__length(selectedIds) - 1] && ', ');
|
|
332
331
|
}), !label && withArrow && ReactCreateElement("span", {
|
|
333
|
-
[
|
|
332
|
+
[ReactConstants[5]]: "arrow"
|
|
334
333
|
}), withReset && ReactCreateElement(Button, {
|
|
335
|
-
[
|
|
334
|
+
[ReactConstants[5]]: "reset",
|
|
336
335
|
raised: false,
|
|
337
|
-
|
|
336
|
+
[ReactConstants[6]]: this.clean
|
|
338
337
|
}, removeIcon)), inlineSelected && hasSelected && ReactCreateElement(React.Fragment, null, selectedMode === 'full' && selectedIds.map(function (id) {
|
|
339
338
|
return ReactCreateElement("div", {
|
|
340
|
-
[
|
|
339
|
+
[ReactConstants[5]]: "value",
|
|
341
340
|
key: id
|
|
342
341
|
}, React.createElement(selectedComponent, _objectSpread2(_objectSpread2({}, childProps), {}, {
|
|
343
342
|
id: id,
|
|
344
343
|
label: getLabel(labels, id),
|
|
345
|
-
|
|
344
|
+
[ReactConstants[6]]: setActive
|
|
346
345
|
})), ReactCreateElement("div", {
|
|
347
|
-
[
|
|
348
|
-
|
|
346
|
+
[ReactConstants[5]]: "button remove",
|
|
347
|
+
[ReactConstants[6]]: function onClick(e) {
|
|
349
348
|
stopPropagation(e);
|
|
350
349
|
_this3.remove(id);
|
|
351
350
|
}
|
|
@@ -356,10 +355,10 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
356
355
|
}, React.createElement(selectedComponent, _objectSpread2(_objectSpread2({}, childProps), {}, {
|
|
357
356
|
id: id,
|
|
358
357
|
label: getLabel(labels, id),
|
|
359
|
-
|
|
360
|
-
})), id !== selectedIds[selectedIds
|
|
361
|
-
})), (isActive || !hasSelected && mode !== MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE || mode === MODE_MULTIPLE_AUTO && selectedIds
|
|
362
|
-
[
|
|
358
|
+
[ReactConstants[6]]: setActive
|
|
359
|
+
})), id !== selectedIds[__length(selectedIds) - 1] && ', ');
|
|
360
|
+
})), (isActive || !hasSelected && mode !== MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE || mode === MODE_MULTIPLE_AUTO && __length(selectedIds) > 1 || mode === MODE_INLINE_MULTIPLE) && ReactCreateElement("div", {
|
|
361
|
+
[ReactConstants[5]]: "input",
|
|
363
362
|
"data-value": filterValue
|
|
364
363
|
}, withFilter && ReactCreateElement(TextField, {
|
|
365
364
|
autoComplete: "new-password",
|
|
@@ -368,13 +367,13 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
368
367
|
focused: isActive,
|
|
369
368
|
value: filterValue,
|
|
370
369
|
label: inputLabel,
|
|
371
|
-
|
|
370
|
+
[ReactConstants[7]]: this[ReactConstants[7]],
|
|
372
371
|
onFocus: function onFocus(e) {
|
|
373
372
|
return _this3.setState({
|
|
374
373
|
isActive: true
|
|
375
374
|
});
|
|
376
375
|
},
|
|
377
|
-
check: this.
|
|
376
|
+
check: __props(this).filterCheck,
|
|
378
377
|
onKeyDown: function onKeyDown(e) {
|
|
379
378
|
var keyCode = e.keyCode;
|
|
380
379
|
if (keyCode === 38
|
|
@@ -394,8 +393,8 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
394
393
|
_this3.onSelect(_this3.getSelected());
|
|
395
394
|
} else if (keyCode === 8
|
|
396
395
|
) {
|
|
397
|
-
if (!filterValue && selectedIds
|
|
398
|
-
_this3.remove(selectedIds[selectedIds
|
|
396
|
+
if (!filterValue && __length(selectedIds) !== 0 && isMultipleSelect(mode)) {
|
|
397
|
+
_this3.remove(selectedIds[__length(selectedIds) - 1]);
|
|
399
398
|
}
|
|
400
399
|
_this3.reset();
|
|
401
400
|
} else if (keyCode === 46
|
|
@@ -412,7 +411,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
412
411
|
}
|
|
413
412
|
}
|
|
414
413
|
}), !withFilter && inputLabel && ReactCreateElement("label", null, inputLabel)), ReactCreateElement(FilteredList, {
|
|
415
|
-
[
|
|
414
|
+
[ReactConstants[5]]: classNames(isActive && 'visible'),
|
|
416
415
|
ref: ref('list', this),
|
|
417
416
|
filter: filterFunction,
|
|
418
417
|
selectSingle: !allowCustom,
|
package/Button.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
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";
|
|
2
3
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
3
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import { classNames, createRef, DOCUMENT, addEventListener, orNoop } from './Tools.js';
|
|
@@ -23,14 +22,14 @@ var Button = function (_PureComponent) {
|
|
|
23
22
|
var ripple = createRef();
|
|
24
23
|
var rippleClassName = stateGS(that);
|
|
25
24
|
var onMouseDown = function onMouseDown(e) {
|
|
26
|
-
if (!
|
|
27
|
-
var rect = el()
|
|
25
|
+
if (!props(that).withRipple) return;
|
|
26
|
+
var rect = el().getBoundingClientRect();
|
|
28
27
|
var rippleElement = ripple();
|
|
29
|
-
var style = rippleElement
|
|
28
|
+
var style = __style(rippleElement);
|
|
30
29
|
var body = DOCUMENT.body;
|
|
31
|
-
style
|
|
32
|
-
style
|
|
33
|
-
style
|
|
30
|
+
style.height = style.width = Math.max(__width(rect), __height(rect)) + 'px';
|
|
31
|
+
style.top = __pageY(e) - __top(rect) - rippleElement.offsetHeight / 2 - __scrollTop(body) + 'px';
|
|
32
|
+
style.left = __pageX(e) - __left(rect) - rippleElement.offsetWidth / 2 - __scrollLeft(body) + 'px';
|
|
34
33
|
rippleClassName('show');
|
|
35
34
|
addEventListener(rippleElement, 'animationend', function () {
|
|
36
35
|
rippleClassName('showed');
|
|
@@ -39,37 +38,37 @@ var Button = function (_PureComponent) {
|
|
|
39
38
|
var onFocus = function onFocus(e) {
|
|
40
39
|
orNoop(props(that).onFocus)(e);
|
|
41
40
|
if (rippleClassName() === 'show') return;
|
|
42
|
-
var rect = el()
|
|
43
|
-
var style = ripple()
|
|
44
|
-
var size = Math.max(rect
|
|
45
|
-
style
|
|
46
|
-
style
|
|
47
|
-
style
|
|
41
|
+
var rect = el().getBoundingClientRect();
|
|
42
|
+
var style = __style(ripple());
|
|
43
|
+
var size = Math.max(__width(rect), __height(rect)) * 0.8;
|
|
44
|
+
style.height = style.width = size + 'px';
|
|
45
|
+
style.top = __height(rect) / 2 - size / 2 + 'px';
|
|
46
|
+
style.left = __width(rect) / 2 - size / 2 + 'px';
|
|
48
47
|
rippleClassName('focused');
|
|
49
48
|
};
|
|
50
|
-
that[
|
|
49
|
+
that[ReactConstants[3]] = function () {
|
|
51
50
|
var _props = props(that),
|
|
52
|
-
children = _props[
|
|
51
|
+
children = _props[ReactConstants[4]],
|
|
53
52
|
type = _props.type,
|
|
54
|
-
className = _props[
|
|
55
|
-
onClick = _props
|
|
53
|
+
className = _props[ReactConstants[5]],
|
|
54
|
+
onClick = _props[ReactConstants[6]],
|
|
56
55
|
flat = _props.flat,
|
|
57
56
|
_props$raised = _props.raised,
|
|
58
57
|
raised = _props$raised === void 0 ? !flat : _props$raised,
|
|
59
58
|
round = _props.round,
|
|
60
|
-
style = _props
|
|
59
|
+
style = __style(_props),
|
|
61
60
|
disabled = _props.disabled;
|
|
62
61
|
return ReactCreateElement("button", {
|
|
63
|
-
[
|
|
62
|
+
[ReactConstants[5]]: classNames('Button', className, disabled && 'disabled', raised && 'raised', flat && 'flat', round && 'round'),
|
|
64
63
|
onFocus: onFocus,
|
|
65
64
|
disabled: disabled,
|
|
66
65
|
style: style,
|
|
67
66
|
type: type,
|
|
68
|
-
|
|
67
|
+
[ReactConstants[6]]: onClick,
|
|
69
68
|
onMouseDown: onMouseDown,
|
|
70
69
|
ref: el
|
|
71
70
|
}, children, ReactCreateElement("span", {
|
|
72
|
-
[
|
|
71
|
+
[ReactConstants[5]]: classNames("ripple", rippleClassName()),
|
|
73
72
|
ref: ripple
|
|
74
73
|
}));
|
|
75
74
|
};
|
|
@@ -85,8 +84,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
85
84
|
disabled: PropTypes.bool,
|
|
86
85
|
withRipple: PropTypes.bool,
|
|
87
86
|
type: PropTypes.oneOf(['button', 'submit', 'reset']),
|
|
88
|
-
[
|
|
89
|
-
|
|
87
|
+
[ReactConstants[5]]: PropTypes.string,
|
|
88
|
+
[ReactConstants[6]]: PropTypes.func,
|
|
90
89
|
onFocus: PropTypes.func,
|
|
91
90
|
style: PropTypes.object
|
|
92
91
|
};
|
package/Checkbox.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
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";
|
|
2
3
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
3
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import { classNames, getRandomId } from './Tools.js';
|
|
@@ -20,22 +19,22 @@ var Checkbox = function (_PureComponent) {
|
|
|
20
19
|
_this = _super.call(this, properties);
|
|
21
20
|
var randomId = getRandomId('cb-');
|
|
22
21
|
var props = propsGetter(_assertThisInitialized(_this));
|
|
23
|
-
_this[
|
|
22
|
+
_this[ReactConstants[3]] = function () {
|
|
24
23
|
var _props = props(),
|
|
25
24
|
label = _props.label,
|
|
26
25
|
name = _props.name,
|
|
27
|
-
onChange = _props
|
|
28
|
-
value = _props
|
|
29
|
-
className = _props[
|
|
26
|
+
onChange = _props[ReactConstants[7]],
|
|
27
|
+
value = __value(_props),
|
|
28
|
+
className = _props[ReactConstants[5]],
|
|
30
29
|
disabled = _props.disabled;
|
|
31
30
|
var id = props().id || randomId;
|
|
32
31
|
return ReactCreateElement("div", {
|
|
33
|
-
[
|
|
32
|
+
[ReactConstants[5]]: classNames("Checkbox", className)
|
|
34
33
|
}, ReactCreateElement("input", {
|
|
35
34
|
name: name,
|
|
36
35
|
id: id,
|
|
37
36
|
type: "checkbox",
|
|
38
|
-
|
|
37
|
+
[ReactConstants[7]]: onChange,
|
|
39
38
|
checked: value,
|
|
40
39
|
disabled: disabled
|
|
41
40
|
}), ReactCreateElement("label", {
|
|
@@ -48,10 +47,10 @@ var Checkbox = function (_PureComponent) {
|
|
|
48
47
|
}(PureComponent);
|
|
49
48
|
if (process.env.NODE_ENV !== 'production') {
|
|
50
49
|
Checkbox.propTypes = {
|
|
51
|
-
|
|
50
|
+
[ReactConstants[7]]: PropTypes.func.isRequired,
|
|
52
51
|
value: PropTypes.bool,
|
|
53
52
|
disabled: PropTypes.bool,
|
|
54
|
-
[
|
|
53
|
+
[ReactConstants[5]]: PropTypes.string,
|
|
55
54
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
56
55
|
name: PropTypes.string,
|
|
57
56
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
package/CircleProgress.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
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";
|
|
2
3
|
import 'react';
|
|
3
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
10
9
|
|
|
@@ -14,14 +13,14 @@ var dashoffset = function dashoffset(percent) {
|
|
|
14
13
|
return length * (100 - percent) / 100;
|
|
15
14
|
};
|
|
16
15
|
var CircleProgress = function CircleProgress(_ref) {
|
|
17
|
-
var value = _ref
|
|
16
|
+
var value = __value(_ref);
|
|
18
17
|
value = Number.parseFloat(value);
|
|
19
18
|
return ReactCreateElement("div", {
|
|
20
|
-
[
|
|
19
|
+
[ReactConstants[5]]: "CircleProgress"
|
|
21
20
|
}, ReactCreateElement("svg", {
|
|
22
21
|
viewBox: "0 0 24 24"
|
|
23
22
|
}, ReactCreateElement("path", {
|
|
24
|
-
[
|
|
23
|
+
[ReactConstants[5]]: "line",
|
|
25
24
|
style: {
|
|
26
25
|
strokeDashoffset: dashoffset(Number.isFinite(value) ? value : 0),
|
|
27
26
|
strokeDasharray: length
|