react-ui-basics 0.0.171 → 0.0.174

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, isFunction, preventDefault, stopPropagation, getRandomId, isObject, addEventListener, DOCUMENT, removeEventListener, UNDEFINED, classNames, ref } from './Tools.js';
13
+ import { memo, isString, continuousIncludes, orNoop, isObject, preventDefault, stopPropagation, getRandomId, isFunction, 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';
@@ -75,7 +75,7 @@ var AutocompleteSelect = function (_PureComponent) {
75
75
  filterValue = _ref3$filterValue === void 0 ? '' : _ref3$filterValue;
76
76
  _this.setState({
77
77
  selected: prepareSelected(value),
78
- filterValue: allowCustom && isString(value) && !isMultipleSelect(mode) ? value : filterValue
78
+ filterValue: allowCustom && !isMultipleSelect(mode) ? _this.getCustomValue(allowCustom, value, __props(_this).labels) : filterValue
79
79
  });
80
80
  };
81
81
  _this.createFilter = memo(function (prefilter, filterValue, filterValueTrimmed, filter) {
@@ -117,7 +117,15 @@ var AutocompleteSelect = function (_PureComponent) {
117
117
  currentSelection = _this$state.selected;
118
118
  var _this$props$labels = __props(_this).labels,
119
119
  labels = _this$props$labels === void 0 ? {} : _this$props$labels;
120
- if (selectedId == null && (!!filterValue || !required) && allowCustom && (!_this.input || !_this.input.check())) selectedId = filterValue.trim();
120
+ if (selectedId == null && (!!filterValue || !required) && allowCustom && (!_this.input || !_this.input.check())) {
121
+ var trimmedValue = filterValue.trim();
122
+ if (isObject(labels)) {
123
+ var key = Object.keys(labels).find(function (key) {
124
+ return labels[key] === trimmedValue;
125
+ });
126
+ if (key) selectedId = key;
127
+ }
128
+ }
121
129
  var isMultiSelect = isMultipleSelect(mode);
122
130
  if (!selectedId && isMultiSelect) {
123
131
  selectedId = null;
@@ -134,12 +142,7 @@ var AutocompleteSelect = function (_PureComponent) {
134
142
  }
135
143
  var errored = required && Object.keys(selected) === 0;
136
144
  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
- }
145
+ var customValue = _this.getCustomValue(allowCustom, selectedId, labels) || '';
143
146
  var filterValueWithCustom = isMultiSelect ? '' : customValue;
144
147
  _this.setState({
145
148
  isActive: isActive,
@@ -439,6 +442,17 @@ var AutocompleteSelect = function (_PureComponent) {
439
442
  labels: labels
440
443
  }));
441
444
  }
445
+ }, {
446
+ key: "getCustomValue",
447
+ value: function getCustomValue(allowCustom, selectedId) {
448
+ var labels = __length(arguments) > 2 && arguments[2] !== undefined ? arguments[2] : {};
449
+ if (allowCustom && selectedId) {
450
+ var label;
451
+ if (isFunction(labels)) label = labels(selectedId);else label = labels[selectedId];
452
+ if (label && isString(label)) return label;
453
+ }
454
+ return '';
455
+ }
442
456
  }]);
443
457
  return AutocompleteSelect;
444
458
  }(PureComponent);
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/Table.d.ts CHANGED
@@ -7,6 +7,7 @@ declare type Comparator = <T>(a: T, b: T) => number;
7
7
  declare const editorSelect = "Select";
8
8
  declare const editorSwitch = "Switch";
9
9
  export interface RowProps<T> {
10
+ i: number;
10
11
  item: T;
11
12
  disabled?: (t: T) => boolean;
12
13
  editing: any;
@@ -17,12 +18,19 @@ export interface RowProps<T> {
17
18
  onFinishEditing: () => void;
18
19
  handleInputChange: (e: ChangeEvent) => void;
19
20
  setValue: (v: any) => void;
20
- setEditing: (t: T, i: number, field: string) => void;
21
+ setEditing: (t: T, i: number, value?: any) => void;
22
+ onMouseDown?: (e: SyntheticEvent, row: number, column: number) => void;
23
+ onMouseUp?: (e: SyntheticEvent, row: number, column: number) => void;
24
+ onMouseEnter?: (e: SyntheticEvent, row: number, column: number) => void;
25
+ onMouseLeave?: (e: SyntheticEvent, row: number, column: number) => void;
21
26
  }
22
27
  export declare type Formatter<T, V> = ((value?: V, item?: T, format?: string) => ReactElement | string) | ((value: V, item: T) => ReactElement | string) | ((value: V) => ReactElement | string);
28
+ export declare type CellClassName<T> = (item: T, field: string, row: number, column: number) => string;
29
+ export declare type ColumnClassName<T> = string | CellClassName<T>;
23
30
  export interface TableColumn<T> {
24
31
  field?: string;
25
- className?: string;
32
+ className?: ColumnClassName<T>;
33
+ onClick?: (e: SyntheticEvent, startEditing: () => void, item: T, field: string, row: number, column: number) => void;
26
34
  comparator?: Comparator;
27
35
  header?: string | ReactElement;
28
36
  sortable?: boolean;
@@ -45,6 +53,10 @@ export interface TableProps<T> {
45
53
  toKey?: (t: T) => number | string;
46
54
  onChange?: (t: T, cancel: () => void) => void;
47
55
  rowClassName?: string | ((t: T) => string);
56
+ onMouseDown?: (e: SyntheticEvent, row: number, column: number) => void;
57
+ onMouseUp?: (e: SyntheticEvent, row: number, column: number) => void;
58
+ onMouseEnter?: (e: SyntheticEvent, row: number, column: number) => void;
59
+ onMouseLeave?: (e: SyntheticEvent, row: number, column: number) => void;
48
60
  }
49
61
  export interface TableState<T> {
50
62
  sortOrder?: SortOrder;
@@ -53,6 +65,9 @@ export interface TableState<T> {
53
65
  data?: T[];
54
66
  }
55
67
  declare class Table<T> extends Component<TableProps<T>, TableState<T>> {
68
+ startEditing: (item: any, columnIndex: any, value?: any) => void;
69
+ finishEditing: () => void;
70
+ isEditing: () => boolean;
56
71
  constructor(properties: any);
57
72
  }
58
73
  export interface TableColumnSelect extends TableColumn<any> {
package/Table.js CHANGED
@@ -10,7 +10,7 @@ import { Component } from 'react';
10
10
  import TextField from './TextField.js';
11
11
  import AutocompleteSelect, { MODE_MULTIPLE_MINI, MODE_DEFAULT } from './AutocompleteSelect.js';
12
12
  import Switch from './Switch.js';
13
- import { setInterval, classNames, isFunction, NOOP, preventDefault, stopPropagation, Comparators, createRef, createAccessor, isString, orNoop } from './Tools.js';
13
+ import { setInterval, classNames, isFunction, UNDEFINED, isString, preventDefault, stopPropagation, Comparators, createRef, createAccessor, orNoop, NOOP } from './Tools.js';
14
14
  import MaterialIcon from './MaterialIcon.js';
15
15
  import { stateGSs, componentDidMount, componentDidUpdate, render, componentWillUnmount, PureComponent, propsGetter } from './ReactConstants.js';
16
16
 
@@ -38,9 +38,13 @@ var Table = /** @class */ (function (_super) {
38
38
  var cancelEditing = function () {
39
39
  editingState(false);
40
40
  };
41
- var setEditing = function (item, columnIndex, field) {
42
- editingState({ id: item.id, value: item[field], columnIndex: columnIndex, item: item, field: field });
41
+ var setEditing = function (item, columnIndex, value) {
42
+ var columns = props().columns;
43
+ var field = columns[columnIndex].field;
44
+ editingState({ id: item.id, value: (value != null ? value : item[field]), columnIndex: columnIndex, item: item, field: field });
43
45
  };
46
+ _this.startEditing = setEditing;
47
+ _this.isEditing = function () { return !!editingState(); };
44
48
  var handleInputChange = function (event) {
45
49
  var target = __target(event);
46
50
  var value = target.type === 'checkbox' ? target.checked : __value(target);
@@ -49,7 +53,7 @@ var Table = /** @class */ (function (_super) {
49
53
  var onFinishEditing = function () {
50
54
  var _a;
51
55
  var editing = editingState();
52
- if (__value(editing) === null)
56
+ if (!editing || __value(editing) === null)
53
57
  return;
54
58
  var value = __value(editing);
55
59
  if (isString(value))
@@ -59,6 +63,7 @@ var Table = /** @class */ (function (_super) {
59
63
  var updated = __extends(__extends({}, editing.item), (_a = {}, _a[editing.field] = value, _a));
60
64
  props()[ReactConstants[7]](updated, cancelEditing);
61
65
  };
66
+ _this.finishEditing = onFinishEditing;
62
67
  var setValue = function (value) {
63
68
  editingState(__extends(__extends({}, editingState()), { value: value }), onFinishEditing);
64
69
  };
@@ -102,7 +107,7 @@ var Table = /** @class */ (function (_super) {
102
107
  updateHeaders();
103
108
  };
104
109
  _this[ReactConstants[3]] = function () {
105
- var _a = props(), _b = _a.columns, columns = _b === void 0 ? [] : _b, _c = _a.onRowClick, onRowClick = _c === void 0 ? NOOP : _c, disabled = _a.disabled, className = _a[ReactConstants[5]], rowClassName = _a.rowClassName, _d = _a.toKey, toKey = _d === void 0 ? getId : _d;
110
+ var _a = props(), _b = _a.columns, columns = _b === void 0 ? [] : _b, _c = _a.onRowClick, onRowClick = _c === void 0 ? NOOP : _c, disabled = _a.disabled, className = _a[ReactConstants[5]], rowClassName = _a.rowClassName, _d = _a.toKey, toKey = _d === void 0 ? getId : _d, onMouseDown = _a.onMouseDown, onMouseUp = _a.onMouseUp, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
106
111
  var sortBy = sortByState();
107
112
  var sortOrder = sortOrderState();
108
113
  var editing = editingState();
@@ -110,7 +115,7 @@ var Table = /** @class */ (function (_super) {
110
115
  return (jsxRuntime_1("table", __extends({ [ReactConstants[5]]: classNames("Table", className) }, { [ReactConstants[4]]: [jsxRuntime_2("thead", { [ReactConstants[4]]: jsxRuntime_2("tr", __extends({ ref: headers }, { [ReactConstants[4]]: columns.filter(function (it) { return !!it; }).map(function (column, i) {
111
116
  var sortable = column.sortable || column.sortable == null;
112
117
  return (jsxRuntime_1("th", __extends({ [ReactConstants[6]]: function (e) { return sortable && sort(e, column.field, comparatorGetter(column)); } }, { [ReactConstants[4]]: [jsxRuntime_1("div", __extends({ [ReactConstants[5]]: classNames('hidden', sortable && 'sortable', sortBy === column.field && 'active') }, { [ReactConstants[4]]: [column.header, column.header && sortBy === column.field && sortOrder === SORT_ASC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_up' })), column.header && sortBy === column.field && sortOrder === SORT_DESC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_down' }))] })), jsxRuntime_1("div", __extends({ [ReactConstants[5]]: classNames('fixed', sortable && 'sortable', sortBy === column.field && 'active') }, { [ReactConstants[4]]: [column.header, column.header && sortBy === column.field && sortOrder === SORT_ASC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_up' })), column.header && sortBy === column.field && sortOrder === SORT_DESC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_down' }))] }))] }), i));
113
- }) })) }), jsxRuntime_2("tbody", { [ReactConstants[4]]: data.map(function (item) { return (jsxRuntime_2(Row, { item: item, disabled: disabled, editing: editing && editing.id === toKey(item) ? editing : null, [ReactConstants[6]]: onRowClick, [ReactConstants[5]]: rowClassName, columns: columns, setEditing: setEditing, cancelEditing: cancelEditing, onFinishEditing: onFinishEditing, handleInputChange: handleInputChange, setValue: setValue }, toKey(item))); }) })] })));
118
+ }) })) }), jsxRuntime_2("tbody", { [ReactConstants[4]]: data.map(function (item, i) { return (jsxRuntime_2(Row, { i: i, item: item, disabled: disabled, editing: editing && editing.id === toKey(item) ? editing : null, [ReactConstants[6]]: onRowClick, [ReactConstants[5]]: rowClassName, columns: columns, setEditing: setEditing, cancelEditing: cancelEditing, onFinishEditing: onFinishEditing, handleInputChange: handleInputChange, setValue: setValue, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, toKey(item))); }) })] })));
114
119
  };
115
120
  _this[ReactConstants[1]] = function () {
116
121
  clearInterval(updateHeadersInterval);
@@ -130,11 +135,19 @@ var Row = /** @class */ (function (_super) {
130
135
  return _super !== null && _super.apply(this, arguments) || this;
131
136
  }
132
137
  Row.prototype[ReactConstants[3]] = function () {
133
- var _a = __props(this), item = _a.item, disabled = _a.disabled, editing = _a.editing, onClick = _a[ReactConstants[6]], className = _a[ReactConstants[5]], columns = _a.columns, setEditing = _a.setEditing, cancelEditing = _a.cancelEditing, onFinishEditing = _a.onFinishEditing, handleInputChange = _a.handleInputChange, setValue = _a.setValue;
134
- return jsxRuntime_2("tr", __extends({ [ReactConstants[6]]: function (e) { return onClick(item, e); }, [ReactConstants[5]]: classNames(disabled && disabled(item) && 'disabled', className && (isFunction(className) ? className(item) : className)) }, { [ReactConstants[4]]: columns.filter(function (it) { return !!it; }).map(function (column, i) {
135
- var isEditing = editing && editing.columnIndex === i;
138
+ var _a = __props(this), item = _a.item, i = _a.i, disabled = _a.disabled, editing = _a.editing, onClick = _a[ReactConstants[6]], className = _a[ReactConstants[5]], columns = _a.columns, setEditing = _a.setEditing, cancelEditing = _a.cancelEditing, onFinishEditing = _a.onFinishEditing, handleInputChange = _a.handleInputChange, setValue = _a.setValue, onMouseDown = _a.onMouseDown, onMouseEnter = _a.onMouseEnter, onMouseUp = _a.onMouseUp, onMouseLeave = _a.onMouseLeave;
139
+ return jsxRuntime_2("tr", __extends({ [ReactConstants[6]]: function (e) { return onClick(item, e); }, [ReactConstants[5]]: classNames(disabled && disabled(item) && 'disabled', className && (isFunction(className) ? className(item) : className)) }, { [ReactConstants[4]]: columns.filter(function (it) { return !!it; }).map(function (column, j) {
140
+ var isEditing = editing && editing.columnIndex === j;
136
141
  var editable = isFunction(column.editable) ? column.editable(item) : !!column.editable;
137
- return (jsxRuntime_1("td", __extends({ [ReactConstants[5]]: classNames(editable ? 'editable' : 'ro', isEditing && 'editing', column[ReactConstants[5]]), [ReactConstants[6]]: !isEditing && editable ? function () { return setEditing(item, i, column.field); } : NOOP }, { [ReactConstants[4]]: [(isEditing || column.displayEditor) && !column.editor && (jsxRuntime_2(TextField, { value: column.preEditor ? column.preEditor(__value(editing)) : __value(editing), focused: true, onBlur: cancelEditing, [ReactConstants[7]]: handleInputChange, onKeyDown: function (e) {
142
+ var startEditing = !isEditing && editable ? function () { return setEditing(item, j); } : NOOP;
143
+ var onClick = (!!column[ReactConstants[6]] ? function (e) { return column[ReactConstants[6]](e, startEditing, item, column.field, i, j); } : startEditing);
144
+ var displayEditor = isEditing || column.displayEditor;
145
+ var value = item[column.field];
146
+ if (editing) {
147
+ value = __value(editing) != null ? __value(editing) : value;
148
+ value = column.preEditor ? column.preEditor(value) : value;
149
+ }
150
+ return (jsxRuntime_1("td", __extends({ onMouseDown: onMouseDown ? function (e) { return onMouseDown(e, i, j); } : UNDEFINED, onMouseUp: onMouseUp ? function (e) { return onMouseUp(e, i, j); } : UNDEFINED, onMouseEnter: onMouseEnter ? function (e) { return onMouseEnter(e, i, j); } : UNDEFINED, onMouseLeave: onMouseLeave ? function (e) { return onMouseLeave(e, i, j); } : UNDEFINED, [ReactConstants[5]]: classNames(editable ? 'editable' : 'ro', isEditing && 'editing', isString(column[ReactConstants[5]]) && column[ReactConstants[5]], isFunction(column[ReactConstants[5]]) && column[ReactConstants[5]](item, column.field, i, j)), [ReactConstants[6]]: onClick }, { [ReactConstants[4]]: [displayEditor && !column.editor && (jsxRuntime_2(TextField, { value: value, focused: true, onBlur: cancelEditing, [ReactConstants[7]]: handleInputChange, onKeyDown: function (e) {
138
151
  if (e.keyCode === 27 /*escape*/) {
139
152
  preventDefault(e);
140
153
  cancelEditing();
@@ -143,12 +156,12 @@ var Row = /** @class */ (function (_super) {
143
156
  preventDefault(e);
144
157
  onFinishEditing();
145
158
  }
146
- } })), (isEditing || column.displayEditor) && column.editor === editorSelect && (jsxRuntime_2(AutocompleteSelect, { value: column.preEditor ? column.preEditor(__value(editing)) : __value(editing), data: column.editorData, focused: true, withArrow: false, withFilter: false, selectedMode: 'inline', selectedComponent: column.editorSelectedComponent, mode: column.multiSelect ? MODE_MULTIPLE_MINI : MODE_DEFAULT, [ReactConstants[7]]: column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), onSelect: !column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), childComponent: column.editorChildCompononent, onCancel: cancelEditing, prefilter: column.prefilter })), (isEditing || column.displayEditor) && column.editor === editorSwitch && (jsxRuntime_2(Switch, { [ReactConstants[6]]: function (e) {
159
+ } })), displayEditor && column.editor === editorSelect && (jsxRuntime_2(AutocompleteSelect, { value: value, data: column.editorData, focused: true, withArrow: false, withFilter: false, selectedMode: 'inline', selectedComponent: column.editorSelectedComponent, mode: column.multiSelect ? MODE_MULTIPLE_MINI : MODE_DEFAULT, [ReactConstants[7]]: column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), onSelect: !column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), childComponent: column.editorChildCompononent, onCancel: cancelEditing, prefilter: column.prefilter })), displayEditor && column.editor === editorSwitch && (jsxRuntime_2(Switch, { [ReactConstants[6]]: function (e) {
147
160
  stopPropagation(e);
148
161
  preventDefault(e);
149
- setValue(!item[column.field]);
150
- }, value: item[column.field] })), (isEditing || column.displayEditor) && isFunction(column.editor)
151
- && column.editor(item, cancelEditing, isEditing), !isEditing && !column.displayEditor && formatValue(item, column)] }), i));
162
+ setValue(!value);
163
+ }, value: value })), displayEditor && isFunction(column.editor)
164
+ && column.editor(item, cancelEditing, isEditing), !isEditing && !column.displayEditor && formatValue(item, column)] }), j));
152
165
  }) }));
153
166
  };
154
167
  return Row;
package/TextField.js CHANGED
@@ -113,8 +113,10 @@ var TextField = function (_PureComponent) {
113
113
  var hasValue = !!__value(i);
114
114
  isWithValue(hasValue);
115
115
  !hasValue && setTimeout(function () {
116
- var matches = i.matches(':-internal-autofill-selected');
117
- matches && isWithValue(matches);
116
+ try {
117
+ var matches = i.matches(':-internal-autofill-selected');
118
+ matches && isWithValue(matches);
119
+ } catch (ignored) {}
118
120
  }, 100);
119
121
  focused && i.focus();
120
122
  orNoop(input)(i);
package/bundle.css CHANGED
@@ -1,3 +1,12 @@
1
+ .animated {
2
+ transition: opacity 250ms ease;
3
+ opacity: 0;
4
+ }
5
+
6
+ .animated.mounting, .animated.mounted {
7
+ opacity: 1;
8
+ }
9
+
1
10
  .Button {
2
11
  position: relative;
3
12
  min-width: 64px;
@@ -164,70 +173,6 @@
164
173
  border: 0;
165
174
  }
166
175
 
167
- .CircleProgress {
168
- width: 48px;
169
- height: 48px;
170
- }
171
-
172
- .CircleProgress .line {
173
- stroke-width: 2px;
174
- stroke: black;
175
- stroke-linecap: square;
176
- fill: none;
177
- transition: stroke-dashoffset 0.2s ease;
178
- }
179
-
180
- .animated {
181
- transition: opacity 250ms ease;
182
- opacity: 0;
183
- }
184
-
185
- .animated.mounting, .animated.mounted {
186
- opacity: 1;
187
- }
188
-
189
- .DialogModal {
190
- overflow: hidden;
191
- }
192
-
193
- .DialogModal .content {
194
- top: 20vh;
195
- }
196
-
197
- .Dialog {
198
- background-color: white;
199
- min-width: 460px;
200
- max-width: 40vw;
201
- padding: 15px;
202
- }
203
-
204
- .Dialog .title {
205
- margin-bottom: 15px;
206
- padding: 20px 50px 0px 30px;
207
- font-size: 1.25rem;
208
- line-height: 2rem;
209
- font-weight: 400;
210
- letter-spacing: 0.0125em;
211
- }
212
-
213
- .Dialog .description {
214
- color: rgba(0, 0, 0, 0.54);
215
- font-size: 1rem;
216
- line-height: 1.5rem;
217
- font-weight: 400;
218
- letter-spacing: 0.03125em;
219
- margin-top: 20px;
220
- padding: 0 24px 24px;
221
- }
222
-
223
- .Dialog > div.row {
224
- margin-bottom: 15px;
225
- }
226
-
227
- .Dialog > div.row:last-child {
228
- margin-bottom: 0;
229
- }
230
-
231
176
  .Checkbox {
232
177
  position: relative;
233
178
  white-space: pre;
@@ -295,33 +240,6 @@
295
240
  background: rgba(0, 0, 0, 0.26);
296
241
  }
297
242
 
298
- .DropFileInput {
299
- flex-grow: 1;
300
- }
301
-
302
- .DropFileInput .Dropzone {
303
- border: 1px dashed #808080;
304
- padding: 12px;
305
- display: flex;
306
- flex-flow: row nowrap;
307
- justify-content: center;
308
- align-items: center;
309
- color: gray;
310
- cursor: pointer;
311
- border-radius: 3px;
312
- font-weight: normal;
313
- line-height: 22px;
314
- font-size: 14px;
315
- color: #7E7E7E;
316
- max-width: 100%;
317
- word-break: break-all;
318
- word-break: break-word;
319
- }
320
-
321
- .DropFileInput .Dropzone .icon.withText {
322
- margin-right: 10px;
323
- }
324
-
325
243
  .AutocompleteSelect {
326
244
  display: inline-flex;
327
245
  flex-flow: column;
@@ -649,6 +567,61 @@
649
567
  pointer-events: none;
650
568
  }
651
569
 
570
+ .DialogModal {
571
+ overflow: hidden;
572
+ }
573
+
574
+ .DialogModal .content {
575
+ top: 20vh;
576
+ }
577
+
578
+ .Dialog {
579
+ background-color: white;
580
+ min-width: 460px;
581
+ max-width: 40vw;
582
+ padding: 15px;
583
+ }
584
+
585
+ .Dialog .title {
586
+ margin-bottom: 15px;
587
+ padding: 20px 50px 0px 30px;
588
+ font-size: 1.25rem;
589
+ line-height: 2rem;
590
+ font-weight: 400;
591
+ letter-spacing: 0.0125em;
592
+ }
593
+
594
+ .Dialog .description {
595
+ color: rgba(0, 0, 0, 0.54);
596
+ font-size: 1rem;
597
+ line-height: 1.5rem;
598
+ font-weight: 400;
599
+ letter-spacing: 0.03125em;
600
+ margin-top: 20px;
601
+ padding: 0 24px 24px;
602
+ }
603
+
604
+ .Dialog > div.row {
605
+ margin-bottom: 15px;
606
+ }
607
+
608
+ .Dialog > div.row:last-child {
609
+ margin-bottom: 0;
610
+ }
611
+
612
+ .CircleProgress {
613
+ width: 48px;
614
+ height: 48px;
615
+ }
616
+
617
+ .CircleProgress .line {
618
+ stroke-width: 2px;
619
+ stroke: black;
620
+ stroke-linecap: square;
621
+ fill: none;
622
+ transition: stroke-dashoffset 0.2s ease;
623
+ }
624
+
652
625
  .Scrollable {
653
626
  max-height: 250px;
654
627
  max-width: 250px;
@@ -768,6 +741,33 @@
768
741
  bottom: -100px;
769
742
  }
770
743
 
744
+ .DropFileInput {
745
+ flex-grow: 1;
746
+ }
747
+
748
+ .DropFileInput .Dropzone {
749
+ border: 1px dashed #808080;
750
+ padding: 12px;
751
+ display: flex;
752
+ flex-flow: row nowrap;
753
+ justify-content: center;
754
+ align-items: center;
755
+ color: gray;
756
+ cursor: pointer;
757
+ border-radius: 3px;
758
+ font-weight: normal;
759
+ line-height: 22px;
760
+ font-size: 14px;
761
+ color: #7E7E7E;
762
+ max-width: 100%;
763
+ word-break: break-all;
764
+ word-break: break-word;
765
+ }
766
+
767
+ .DropFileInput .Dropzone .icon.withText {
768
+ margin-right: 10px;
769
+ }
770
+
771
771
  .ImageGallery {
772
772
  position: fixed;
773
773
  top: 0;
@@ -1063,57 +1063,171 @@
1063
1063
  z-index: 1;
1064
1064
  }
1065
1065
 
1066
- .Modal {
1067
- display: block;
1066
+ .Snackbar {
1067
+ transform: translateX(-50%);
1068
+ overflow: hidden;
1069
+ background-color: #323232;
1070
+ padding: 14px 24px 14px 24px;
1071
+ color: #fff;
1072
+ min-width: 288px;
1073
+ max-width: 568px;
1068
1074
  position: fixed;
1069
- top: 0;
1070
- left: 0;
1071
- right: 0;
1072
- bottom: 100%;
1073
- overflow-y: scroll;
1074
- transition: bottom 0ms linear;
1075
- transition-delay: 0.2s;
1075
+ bottom: -50px;
1076
+ left: 50%;
1077
+ display: flex;
1078
+ flex-wrap: nowrap;
1079
+ align-items: center;
1080
+ opacity: 0;
1081
+ transition: bottom 0.25s ease, opacity 0.2s ease;
1082
+ border-radius: 4px;
1083
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
1076
1084
  }
1077
1085
 
1078
- .Modal.show {
1079
- transition-delay: 0s;
1080
- bottom: 0;
1086
+ .Snackbar.shown {
1087
+ bottom: 15px;
1088
+ opacity: 1;
1081
1089
  }
1082
1090
 
1083
- .Modal > .overlay {
1084
- position: fixed;
1085
- top: 0;
1086
- bottom: 100%;
1087
- left: 0;
1088
- right: 0;
1089
- transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
1090
- opacity: 0;
1091
- background-color: black;
1092
- pointer-events: none;
1091
+ .Snackbar .message {
1092
+ overflow: hidden;
1093
+ line-height: 1.2em;
1094
+ min-height: 1.2em;
1095
+ max-height: 2.4em;
1096
+ flex: 1;
1093
1097
  }
1094
1098
 
1095
- .Modal > .overlay.show {
1096
- opacity: 0.5;
1097
- bottom: 0;
1099
+ .Snackbar .action {
1100
+ text-transform: uppercase;
1101
+ font-weight: bold;
1102
+ margin-left: 48px;
1103
+ color: #bf3727;
1098
1104
  }
1099
1105
 
1100
- .Modal > .content {
1101
- left: 50%;
1102
- top: 10vh;
1103
- margin-bottom: 10vh;
1104
- font-size: 16px;
1105
- padding: 0;
1106
- opacity: 0;
1107
- transition: opacity 0.25s ease, transform 0.25s ease;
1108
- transform: scaleY(0) translateY(-200px) translateX(-50%);
1109
- transform-origin: top;
1110
- position: absolute;
1111
- border-radius: 2px;
1112
- box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3);
1106
+ .Snackbar .action a {
1107
+ text-decoration: none;
1108
+ color: #bf3727;
1113
1109
  }
1114
1110
 
1115
- .Modal > .content.show {
1116
- opacity: 1;
1111
+ .FormUploadProgress {
1112
+ position: absolute;
1113
+ left: 0;
1114
+ right: 0;
1115
+ top: 0;
1116
+ bottom: 0;
1117
+ background-color: rgba(255, 255, 255, 0.6);
1118
+ z-index: 2;
1119
+ }
1120
+
1121
+ .FormUploadProgress.animated.mounting, .FormUploadProgress.animated.mounted {
1122
+ transition-delay: 500ms;
1123
+ }
1124
+
1125
+ .FormUploadProgress .wrapper {
1126
+ position: sticky;
1127
+ top: 40%;
1128
+ margin-top: 40%;
1129
+ margin-left: 50%;
1130
+ transform: translateX(-50%);
1131
+ display: flex;
1132
+ flex-flow: column;
1133
+ justify-content: center;
1134
+ align-items: center;
1135
+ }
1136
+
1137
+ .FormUploadProgress .wrapper .CircleProgress, .FormUploadProgress .wrapper .SpinningProgress {
1138
+ position: absolute;
1139
+ width: 107px;
1140
+ height: 107px;
1141
+ top: 0;
1142
+ left: 0;
1143
+ }
1144
+
1145
+ .FormUploadProgress .wrapper .CircleProgress .line, .FormUploadProgress .wrapper .SpinningProgress .line {
1146
+ stroke: #2196F3;
1147
+ }
1148
+
1149
+ .FormUploadProgress .wrapper > .progress {
1150
+ width: 107px;
1151
+ height: 107px;
1152
+ min-height: 107px;
1153
+ display: flex;
1154
+ justify-content: center;
1155
+ align-items: center;
1156
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);
1157
+ border-radius: 50%;
1158
+ background: white;
1159
+ position: relative;
1160
+ }
1161
+
1162
+ .FormUploadProgress .wrapper > .progress > .value {
1163
+ display: inline-block;
1164
+ margin-top: 5px;
1165
+ font-weight: bold;
1166
+ line-height: 16px;
1167
+ font-size: 13px;
1168
+ text-align: center;
1169
+ color: #818181;
1170
+ }
1171
+
1172
+ .FormUploadProgress .wrapper .cancel {
1173
+ min-width: 107px;
1174
+ margin-top: 20px;
1175
+ background-color: white;
1176
+ color: #F96B5C;
1177
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);
1178
+ }
1179
+
1180
+ .Modal {
1181
+ display: block;
1182
+ position: fixed;
1183
+ top: 0;
1184
+ left: 0;
1185
+ right: 0;
1186
+ bottom: 100%;
1187
+ overflow-y: scroll;
1188
+ transition: bottom 0ms linear;
1189
+ transition-delay: 0.2s;
1190
+ }
1191
+
1192
+ .Modal.show {
1193
+ transition-delay: 0s;
1194
+ bottom: 0;
1195
+ }
1196
+
1197
+ .Modal > .overlay {
1198
+ position: fixed;
1199
+ top: 0;
1200
+ bottom: 100%;
1201
+ left: 0;
1202
+ right: 0;
1203
+ transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
1204
+ opacity: 0;
1205
+ background-color: black;
1206
+ pointer-events: none;
1207
+ }
1208
+
1209
+ .Modal > .overlay.show {
1210
+ opacity: 0.5;
1211
+ bottom: 0;
1212
+ }
1213
+
1214
+ .Modal > .content {
1215
+ left: 50%;
1216
+ top: 10vh;
1217
+ margin-bottom: 10vh;
1218
+ font-size: 16px;
1219
+ padding: 0;
1220
+ opacity: 0;
1221
+ transition: opacity 0.25s ease, transform 0.25s ease;
1222
+ transform: scaleY(0) translateY(-200px) translateX(-50%);
1223
+ transform-origin: top;
1224
+ position: absolute;
1225
+ border-radius: 2px;
1226
+ box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3);
1227
+ }
1228
+
1229
+ .Modal > .content.show {
1230
+ opacity: 1;
1117
1231
  transform: scaleY(1) translateY(0px) translateX(-50%);
1118
1232
  }
1119
1233
 
@@ -1170,133 +1284,6 @@
1170
1284
  margin-left: 4px;
1171
1285
  }
1172
1286
 
1173
- .Snackbar {
1174
- transform: translateX(-50%);
1175
- overflow: hidden;
1176
- background-color: #323232;
1177
- padding: 14px 24px 14px 24px;
1178
- color: #fff;
1179
- min-width: 288px;
1180
- max-width: 568px;
1181
- position: fixed;
1182
- bottom: -50px;
1183
- left: 50%;
1184
- display: flex;
1185
- flex-wrap: nowrap;
1186
- align-items: center;
1187
- opacity: 0;
1188
- transition: bottom 0.25s ease, opacity 0.2s ease;
1189
- border-radius: 4px;
1190
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
1191
- }
1192
-
1193
- .Snackbar.shown {
1194
- bottom: 15px;
1195
- opacity: 1;
1196
- }
1197
-
1198
- .Snackbar .message {
1199
- overflow: hidden;
1200
- line-height: 1.2em;
1201
- min-height: 1.2em;
1202
- max-height: 2.4em;
1203
- flex: 1;
1204
- }
1205
-
1206
- .Snackbar .action {
1207
- text-transform: uppercase;
1208
- font-weight: bold;
1209
- margin-left: 48px;
1210
- color: #bf3727;
1211
- }
1212
-
1213
- .Snackbar .action a {
1214
- text-decoration: none;
1215
- color: #bf3727;
1216
- }
1217
-
1218
- .Switch {
1219
- display: inline-flex;
1220
- padding-top: 5px;
1221
- }
1222
-
1223
- .Switch .switch-input {
1224
- display: none;
1225
- }
1226
-
1227
- .Switch .switch-label {
1228
- position: relative;
1229
- display: inline-flex;
1230
- align-items: center;
1231
- min-width: 38px;
1232
- height: 24px;
1233
- cursor: pointer;
1234
- font-weight: 500;
1235
- text-align: left;
1236
- user-select: none;
1237
- margin: 0;
1238
- padding: 0;
1239
- padding-left: 44px;
1240
- box-sizing: border-box;
1241
- }
1242
-
1243
- .Switch .switch-label:before, .Switch .switch-label:after {
1244
- content: "";
1245
- box-sizing: border-box;
1246
- position: absolute;
1247
- margin: 0;
1248
- outline: 0;
1249
- top: 50%;
1250
- transform: translate(0, -50%);
1251
- transition: all 0.3s ease;
1252
- }
1253
-
1254
- .Switch .switch-label:before {
1255
- left: 1px;
1256
- width: 34px;
1257
- height: 14px;
1258
- background-color: #9E9E9E;
1259
- border-radius: 8px;
1260
- }
1261
-
1262
- .Switch .switch-label:after {
1263
- left: 0;
1264
- width: 20px;
1265
- height: 20px;
1266
- background-color: #FAFAFA;
1267
- border-radius: 50%;
1268
- box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 2px 2px 0 rgba(0, 0, 0, 0.098), 0 1px 5px 0 rgba(0, 0, 0, 0.084);
1269
- }
1270
-
1271
- .Switch .switch-label .toggle--on {
1272
- display: none;
1273
- }
1274
-
1275
- .Switch .switch-label .toggle--off {
1276
- display: inline-block;
1277
- }
1278
-
1279
- .Switch .switch-label .label {
1280
- margin-right: 5px;
1281
- }
1282
-
1283
- .Switch .switch-input:checked + .switch-label:before {
1284
- background-color: #A5D6A7;
1285
- }
1286
-
1287
- .Switch .switch-input:checked + .switch-label:after {
1288
- background-color: #4CAF50;
1289
- transform: translate(80%, -50%);
1290
- }
1291
-
1292
- .Switch .switch-input:checked + .switch-label .toggle--on {
1293
- display: inline-block;
1294
- }
1295
-
1296
- .Switch .switch-input:checked + .switch-label .toggle--off {
1297
- display: none;
1298
- }
1299
-
1300
1287
  .TextField {
1301
1288
  position: relative;
1302
1289
  width: 100%;
@@ -1440,73 +1427,22 @@
1440
1427
  animation-name: shake;
1441
1428
  }
1442
1429
 
1443
- .FormUploadProgress {
1444
- position: absolute;
1445
- left: 0;
1446
- right: 0;
1447
- top: 0;
1448
- bottom: 0;
1449
- background-color: rgba(255, 255, 255, 0.6);
1450
- z-index: 2;
1451
- }
1452
-
1453
- .FormUploadProgress.animated.mounting, .FormUploadProgress.animated.mounted {
1454
- transition-delay: 500ms;
1455
- }
1456
-
1457
- .FormUploadProgress .wrapper {
1458
- position: sticky;
1459
- top: 40%;
1460
- margin-top: 40%;
1461
- margin-left: 50%;
1462
- transform: translateX(-50%);
1463
- display: flex;
1464
- flex-flow: column;
1465
- justify-content: center;
1466
- align-items: center;
1467
- }
1468
-
1469
- .FormUploadProgress .wrapper .CircleProgress, .FormUploadProgress .wrapper .SpinningProgress {
1470
- position: absolute;
1471
- width: 107px;
1472
- height: 107px;
1473
- top: 0;
1474
- left: 0;
1475
- }
1476
-
1477
- .FormUploadProgress .wrapper .CircleProgress .line, .FormUploadProgress .wrapper .SpinningProgress .line {
1478
- stroke: #2196F3;
1430
+ .DNDContainer .DroppableList .Draggable {
1431
+ transform: unset;
1432
+ transition: unset;
1433
+ opacity: 1;
1479
1434
  }
1480
1435
 
1481
- .FormUploadProgress .wrapper > .progress {
1482
- width: 107px;
1483
- height: 107px;
1484
- min-height: 107px;
1485
- display: flex;
1486
- justify-content: center;
1487
- align-items: center;
1488
- box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);
1489
- border-radius: 50%;
1490
- background: white;
1491
- position: relative;
1436
+ .DNDContainer .DroppableList .Draggable.dragged {
1437
+ transition: unset !important;
1492
1438
  }
1493
1439
 
1494
- .FormUploadProgress .wrapper > .progress > .value {
1495
- display: inline-block;
1496
- margin-top: 5px;
1497
- font-weight: bold;
1498
- line-height: 16px;
1499
- font-size: 13px;
1500
- text-align: center;
1501
- color: #818181;
1440
+ .DNDContainer .DroppableList.hover .Draggable {
1441
+ transition: transform 0.2s ease-in;
1502
1442
  }
1503
1443
 
1504
- .FormUploadProgress .wrapper .cancel {
1505
- min-width: 107px;
1506
- margin-top: 20px;
1507
- background-color: white;
1508
- color: #F96B5C;
1509
- box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);
1444
+ .DNDContainer .DroppableList.resetting .Draggable {
1445
+ transition: transform 0.1s ease-in;
1510
1446
  }
1511
1447
 
1512
1448
  .SpinningProgress {
@@ -1562,22 +1498,86 @@
1562
1498
  stroke-dashoffset: -53px;
1563
1499
  }
1564
1500
  }
1565
- .DNDContainer .DroppableList .Draggable {
1566
- transform: unset;
1567
- transition: unset;
1568
- opacity: 1;
1501
+ .Switch {
1502
+ display: inline-flex;
1503
+ padding-top: 5px;
1569
1504
  }
1570
1505
 
1571
- .DNDContainer .DroppableList .Draggable.dragged {
1572
- transition: unset !important;
1506
+ .Switch .switch-input {
1507
+ display: none;
1573
1508
  }
1574
1509
 
1575
- .DNDContainer .DroppableList.hover .Draggable {
1576
- transition: transform 0.2s ease-in;
1510
+ .Switch .switch-label {
1511
+ position: relative;
1512
+ display: inline-flex;
1513
+ align-items: center;
1514
+ min-width: 38px;
1515
+ height: 24px;
1516
+ cursor: pointer;
1517
+ font-weight: 500;
1518
+ text-align: left;
1519
+ user-select: none;
1520
+ margin: 0;
1521
+ padding: 0;
1522
+ padding-left: 44px;
1523
+ box-sizing: border-box;
1577
1524
  }
1578
1525
 
1579
- .DNDContainer .DroppableList.resetting .Draggable {
1580
- transition: transform 0.1s ease-in;
1526
+ .Switch .switch-label:before, .Switch .switch-label:after {
1527
+ content: "";
1528
+ box-sizing: border-box;
1529
+ position: absolute;
1530
+ margin: 0;
1531
+ outline: 0;
1532
+ top: 50%;
1533
+ transform: translate(0, -50%);
1534
+ transition: all 0.3s ease;
1535
+ }
1536
+
1537
+ .Switch .switch-label:before {
1538
+ left: 1px;
1539
+ width: 34px;
1540
+ height: 14px;
1541
+ background-color: #9E9E9E;
1542
+ border-radius: 8px;
1543
+ }
1544
+
1545
+ .Switch .switch-label:after {
1546
+ left: 0;
1547
+ width: 20px;
1548
+ height: 20px;
1549
+ background-color: #FAFAFA;
1550
+ border-radius: 50%;
1551
+ box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 2px 2px 0 rgba(0, 0, 0, 0.098), 0 1px 5px 0 rgba(0, 0, 0, 0.084);
1552
+ }
1553
+
1554
+ .Switch .switch-label .toggle--on {
1555
+ display: none;
1556
+ }
1557
+
1558
+ .Switch .switch-label .toggle--off {
1559
+ display: inline-block;
1560
+ }
1561
+
1562
+ .Switch .switch-label .label {
1563
+ margin-right: 5px;
1564
+ }
1565
+
1566
+ .Switch .switch-input:checked + .switch-label:before {
1567
+ background-color: #A5D6A7;
1568
+ }
1569
+
1570
+ .Switch .switch-input:checked + .switch-label:after {
1571
+ background-color: #4CAF50;
1572
+ transform: translate(80%, -50%);
1573
+ }
1574
+
1575
+ .Switch .switch-input:checked + .switch-label .toggle--on {
1576
+ display: inline-block;
1577
+ }
1578
+
1579
+ .Switch .switch-input:checked + .switch-label .toggle--off {
1580
+ display: none;
1581
1581
  }
1582
1582
 
1583
1583
  .FilteredList {
@@ -1661,6 +1661,14 @@
1661
1661
  margin-bottom: 8px;
1662
1662
  }
1663
1663
 
1664
+ .ScrollableTable .Scrollable .scrollbar {
1665
+ top: 56px;
1666
+ }
1667
+
1668
+ .ScrollableTable .Table {
1669
+ position: static;
1670
+ }
1671
+
1664
1672
  .Table {
1665
1673
  font-family: Roboto, sans-serif;
1666
1674
  font-size: 14px;
@@ -1773,12 +1781,4 @@
1773
1781
  height: 20px;
1774
1782
  padding: 0px;
1775
1783
  background-color: #f0f0f0;
1776
- }
1777
-
1778
- .ScrollableTable .Scrollable .scrollbar {
1779
- top: 56px;
1780
- }
1781
-
1782
- .ScrollableTable .Table {
1783
- position: static;
1784
1784
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-ui-basics",
3
- "version": "0.0.171",
3
+ "version": "0.0.174",
4
4
  "description": "",
5
5
  "module": "index.js",
6
6
  "_main": "index.cjs.js",
@@ -15,9 +15,9 @@
15
15
  },
16
16
  "sideEffects": false,
17
17
  "peerDependencies": {
18
- "prop-types": "^15.7.2",
19
- "react": "^17.0.0",
20
- "react-dom": "^17.0.0",
18
+ "prop-types": ">= 15.7.2",
19
+ "react": ">= 17.0.0",
20
+ "react-dom": ">= 17.0.0",
21
21
  "tslib": "^2.3.1"
22
22
  },
23
23
  "scripts": {