flipper-ui 0.25.0 → 0.25.3
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/core/Advertise.d.ts +4 -11
- package/core/AutoComplete.d.ts +3 -3
- package/core/Avatar.d.ts +3 -3
- package/core/Badge.d.ts +4 -4
- package/core/Box.d.ts +3 -3
- package/core/Button.d.ts +3 -3
- package/core/Card.d.ts +7 -7
- package/core/Checkbox.d.ts +3 -3
- package/core/Chip.d.ts +3 -3
- package/core/ChipField.d.ts +2 -2
- package/core/Collapse.d.ts +3 -3
- package/core/Container.d.ts +2 -2
- package/core/Content.d.ts +2 -2
- package/core/DateTime.d.ts +3 -3
- package/core/Dialog.d.ts +3 -3
- package/core/Divider.d.ts +3 -3
- package/core/Drawer.d.ts +4 -4
- package/core/EditableTable.d.ts +2 -2
- package/core/ExpansionPanel.d.ts +3 -3
- package/core/Fab.d.ts +3 -3
- package/core/Fade.d.ts +3 -3
- package/core/Grow.d.ts +3 -3
- package/core/Header.d.ts +3 -3
- package/core/IconButton.d.ts +3 -3
- package/core/InputAdornment.d.ts +3 -3
- package/core/InputBase.d.ts +3 -3
- package/core/Line.d.ts +3 -3
- package/core/List.d.ts +3 -3
- package/core/ListItem.d.ts +3 -3
- package/core/MaskField.d.ts +4 -4
- package/core/Menu.d.ts +4 -4
- package/core/Node.d.ts +3 -3
- package/core/Pagination.d.ts +3 -3
- package/core/Paper.d.ts +3 -3
- package/core/PinInput.d.ts +12 -0
- package/core/PinInput.js +165 -0
- package/core/Progress.d.ts +3 -3
- package/core/Radio.d.ts +3 -3
- package/core/RadioGroup.d.ts +4 -4
- package/core/Select.d.ts +5 -3
- package/core/Select.js +42 -13
- package/core/Sidebar.d.ts +5 -5
- package/core/Sidebar.js +2 -1
- package/core/Slide.d.ts +3 -3
- package/core/Slider.d.ts +3 -3
- package/core/Snackbar.d.ts +3 -3
- package/core/Stepper.d.ts +3 -3
- package/core/Tab.d.ts +3 -3
- package/core/Table.d.ts +5 -5
- package/core/TableBody.d.ts +2 -2
- package/core/TableCell.d.ts +5 -5
- package/core/TableHead.d.ts +3 -3
- package/core/TableRow.d.ts +4 -4
- package/core/Tabs.d.ts +3 -3
- package/core/TextField.d.ts +8 -6
- package/core/TextField.js +62 -15
- package/core/ThemeProvider.d.ts +2 -2
- package/core/Tooltip.d.ts +3 -3
- package/core/Tree.d.ts +2 -2
- package/core/Typography.d.ts +2 -2
- package/core/Zoom.d.ts +3 -3
- package/core/types.d.ts +9 -0
- package/core/types.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +9 -1
- package/package.json +84 -79
- package/stories/Advertise.stories.js +31 -0
- package/stories/AutoComplete.stories.js +133 -0
- package/stories/AutoCompleteLab.stories.js +64 -0
- package/stories/Avatar.stories.js +44 -0
- package/stories/Badge.stories.js +63 -0
- package/stories/Box.stories.js +29 -0
- package/stories/Breadcrumb.stories.js +41 -0
- package/stories/Button.stories.js +132 -0
- package/stories/Card.stories.js +43 -0
- package/stories/Checkbox.stories.js +98 -0
- package/stories/Chip.stories.js +72 -0
- package/stories/ChipField.stories.js +60 -0
- package/stories/Collapse.stories.js +70 -0
- package/stories/Container.stories.js +24 -0
- package/stories/Content.stories.js +28 -0
- package/stories/DataTable.stories.js +737 -0
- package/stories/Dialog.stories.js +82 -0
- package/stories/Divider.stories.js +46 -0
- package/stories/Drawer.stories.js +55 -0
- package/stories/EditTable.stories.js +149 -0
- package/stories/ExpansionPanel.stories.js +54 -0
- package/stories/Fab.stories.js +28 -0
- package/stories/Fade.stories.js +54 -0
- package/stories/Grow.stories.js +63 -0
- package/stories/Header.stories.js +41 -0
- package/stories/IconButton.stories.js +48 -0
- package/stories/InputAdornment.stories.js +28 -0
- package/stories/InputBase.stories.js +54 -0
- package/stories/Line.stories.js +35 -0
- package/stories/List.stories.js +112 -0
- package/stories/MaskField.stories.js +58 -0
- package/stories/Menu.stories.js +82 -0
- package/stories/Node.stories.js +39 -0
- package/stories/Pagination.stories.js +39 -0
- package/stories/Paper.stories.js +65 -0
- package/stories/PinInput.stories.js +133 -0
- package/stories/Progress.stories.js +86 -0
- package/stories/Radio.stories.js +52 -0
- package/stories/RadioGroup.stories.js +47 -0
- package/stories/Select.stories.js +100 -0
- package/stories/Sidebar.stories.js +43 -0
- package/stories/Slide.stories.js +62 -0
- package/stories/Slider.stories.js +69 -0
- package/stories/Snackbar.stories.js +102 -0
- package/stories/Stepper.stories.js +43 -0
- package/stories/Table.stories.js +32 -0
- package/stories/Tabs.stories.js +37 -0
- package/stories/TextField.stories.js +151 -0
- package/stories/Tooltip.stories.js +129 -0
- package/stories/Tree.stories.js +45 -0
- package/stories/Typography.stories.js +130 -0
- package/stories/Zooms.stories.js +54 -0
- package/docz/Wrapper.js +0 -25
package/core/PinInput.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
15
|
+
|
|
16
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
17
|
+
|
|
18
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
|
|
20
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
21
|
+
|
|
22
|
+
var removeValuesFromArray = function removeValuesFromArray(valuesArray, value) {
|
|
23
|
+
var valueIndex = valuesArray.findIndex(function (entry) {
|
|
24
|
+
return entry === value;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (valueIndex === -1) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
valuesArray.splice(valueIndex, 1);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var PIN_MIN_VALUE = 0;
|
|
35
|
+
var PIN_MAX_VALUE = 9;
|
|
36
|
+
var BACKSPACE_KEY = 'Backspace';
|
|
37
|
+
|
|
38
|
+
var PinInput = function PinInput(_ref) {
|
|
39
|
+
var pinLength = _ref.pinLength,
|
|
40
|
+
pin = _ref.pin,
|
|
41
|
+
setPin = _ref.setPin,
|
|
42
|
+
onPinChanged = _ref.onPinChanged,
|
|
43
|
+
validationResult = _ref.validationResult,
|
|
44
|
+
isValidating = _ref.isValidating,
|
|
45
|
+
size = _ref.size;
|
|
46
|
+
var inputRefs = (0, _react.useRef)([]);
|
|
47
|
+
|
|
48
|
+
var changePinFocus = function changePinFocus(pinIndex) {
|
|
49
|
+
var ref = inputRefs.current[pinIndex];
|
|
50
|
+
|
|
51
|
+
if (ref) {
|
|
52
|
+
ref.focus();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
(0, _react.useEffect)(function () {
|
|
57
|
+
changePinFocus(0);
|
|
58
|
+
}, [isValidating]);
|
|
59
|
+
|
|
60
|
+
var onPaste = function onPaste(event) {
|
|
61
|
+
var pastedValue = event.clipboardData.getData('text/plain');
|
|
62
|
+
var splitValues = pastedValue.split('');
|
|
63
|
+
var intValues = [];
|
|
64
|
+
|
|
65
|
+
var _iterator = _createForOfIteratorHelper(splitValues),
|
|
66
|
+
_step;
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
70
|
+
var value = _step.value;
|
|
71
|
+
intValues.push(parseInt(value));
|
|
72
|
+
}
|
|
73
|
+
} catch (err) {
|
|
74
|
+
_iterator.e(err);
|
|
75
|
+
} finally {
|
|
76
|
+
_iterator.f();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
setPin(intValues);
|
|
80
|
+
changePinFocus(intValues.length - 1);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var _onChange = function onChange(event, index) {
|
|
84
|
+
if (event.target.value.length > 1) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var previousValue = event.target.defaultValue;
|
|
89
|
+
var valuesArray = event.target.value.split('');
|
|
90
|
+
removeValuesFromArray(valuesArray, previousValue);
|
|
91
|
+
var value = valuesArray.pop();
|
|
92
|
+
|
|
93
|
+
if (!value) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var pinNumber = Number(value.trim());
|
|
98
|
+
|
|
99
|
+
if (isNaN(pinNumber) || value.length === 0) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (pinNumber >= PIN_MIN_VALUE && pinNumber <= PIN_MAX_VALUE) {
|
|
104
|
+
onPinChanged(pinNumber, index);
|
|
105
|
+
|
|
106
|
+
if (index < pinLength - 1) {
|
|
107
|
+
changePinFocus(index + 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var _onKeyDown = function onKeyDown(event, index) {
|
|
113
|
+
var keyboardKeyCode = event.nativeEvent.code;
|
|
114
|
+
|
|
115
|
+
if (keyboardKeyCode !== BACKSPACE_KEY) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (pin[index] === undefined) {
|
|
120
|
+
changePinFocus(index - 1);
|
|
121
|
+
} else {
|
|
122
|
+
onPinChanged(undefined, index);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, Array.from({
|
|
127
|
+
length: pinLength
|
|
128
|
+
}, function (_, index) {
|
|
129
|
+
return /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
130
|
+
disabled: isValidating,
|
|
131
|
+
variant: "outlined",
|
|
132
|
+
onKeyDown: function onKeyDown(event) {
|
|
133
|
+
return _onKeyDown(event, index);
|
|
134
|
+
},
|
|
135
|
+
onPaste: onPaste,
|
|
136
|
+
color: "primary",
|
|
137
|
+
error: validationResult,
|
|
138
|
+
style: {
|
|
139
|
+
width: size === 'small' ? '40px' : '40px',
|
|
140
|
+
height: size === 'small' ? '30px' : '40px',
|
|
141
|
+
marginInline: size === 'small' ? '5px' : '10px'
|
|
142
|
+
},
|
|
143
|
+
InputProps: {
|
|
144
|
+
style: {
|
|
145
|
+
width: size === 'small' ? '40px' : '45px',
|
|
146
|
+
textAlign: 'center',
|
|
147
|
+
fontWeight: 'bold',
|
|
148
|
+
fontSize: size === 'small' ? '16px' : '20px',
|
|
149
|
+
padding: 'auto'
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
inputRef: function inputRef(el) {
|
|
153
|
+
inputRefs.current[index] = el;
|
|
154
|
+
},
|
|
155
|
+
key: index,
|
|
156
|
+
onChange: function onChange(event) {
|
|
157
|
+
_onChange(event, index);
|
|
158
|
+
},
|
|
159
|
+
value: pin[index] || ''
|
|
160
|
+
});
|
|
161
|
+
})));
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var _default = PinInput;
|
|
165
|
+
exports["default"] = _default;
|
package/core/Progress.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
3
|
interface ILinear {
|
|
4
4
|
color?: 'primary' | 'secondary';
|
|
5
5
|
valueBuffer?: number;
|
|
@@ -16,9 +16,9 @@ interface ICircular {
|
|
|
16
16
|
color?: 'primary' | 'secondary' | 'inherit';
|
|
17
17
|
variant?: 'determinate' | 'indeterminate' | 'static';
|
|
18
18
|
}
|
|
19
|
-
interface
|
|
19
|
+
interface ProgressProps extends DefaultProps {
|
|
20
20
|
value?: number;
|
|
21
21
|
linear?: boolean;
|
|
22
22
|
}
|
|
23
|
-
declare const Progress: FC<
|
|
23
|
+
declare const Progress: FC<ProgressProps & ICircular & ILinear>;
|
|
24
24
|
export default Progress;
|
package/core/Radio.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChangeEvent, FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface RadioProps extends DefaultProps {
|
|
4
4
|
checked?: boolean;
|
|
5
5
|
color?: 'primary' | 'secondary' | 'default';
|
|
6
6
|
value?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
onChange?: (event: ChangeEvent<HTMLElement>) => void;
|
|
9
9
|
}
|
|
10
|
-
declare const Radio: FC<
|
|
10
|
+
declare const Radio: FC<RadioProps>;
|
|
11
11
|
export default Radio;
|
package/core/RadioGroup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent, FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface RadioGroupProps extends DefaultProps {
|
|
4
4
|
row?: boolean;
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
name: string;
|
|
@@ -8,12 +8,12 @@ interface IProps extends IDefault {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
spacing?: 'default' | 'equal';
|
|
10
10
|
options?: IOption[];
|
|
11
|
-
onChange?: (event: ChangeEvent<
|
|
11
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
12
12
|
}
|
|
13
13
|
interface IOption {
|
|
14
14
|
value: string;
|
|
15
15
|
label?: ReactNode;
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
}
|
|
18
|
-
declare const RadioGroup: FC<
|
|
18
|
+
declare const RadioGroup: FC<RadioGroupProps>;
|
|
19
19
|
export default RadioGroup;
|
package/core/Select.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ChangeEvent, FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface SelectProps extends DefaultProps {
|
|
4
4
|
autoWidth?: boolean;
|
|
5
5
|
value?: string | number;
|
|
6
6
|
multiple?: boolean;
|
|
7
7
|
variant?: 'standard' | 'outlined' | 'filled';
|
|
8
|
+
hasClear?: boolean;
|
|
9
|
+
onClear?: () => void;
|
|
8
10
|
onClose?: () => void;
|
|
9
11
|
onChange?: (event: ChangeEvent<HTMLSelectElement | HTMLInputElement>) => void;
|
|
10
12
|
}
|
|
11
|
-
declare const Select: FC<
|
|
13
|
+
declare const Select: FC<SelectProps>;
|
|
12
14
|
export default Select;
|
package/core/Select.js
CHANGED
|
@@ -13,26 +13,38 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _InputAdornment = _interopRequireDefault(require("@material-ui/core/InputAdornment"));
|
|
19
|
+
|
|
20
|
+
var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
19
21
|
|
|
20
22
|
var _styles = require("@material-ui/core/styles");
|
|
21
23
|
|
|
24
|
+
var _Clear = _interopRequireDefault(require("@material-ui/icons/Clear"));
|
|
25
|
+
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
|
+
|
|
22
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23
29
|
|
|
24
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
31
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
var iconStyle = {
|
|
33
|
+
right: '2px'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var renderEndAdornment = function renderEndAdornment(onClear) {
|
|
37
|
+
return /*#__PURE__*/_react["default"].createElement(_InputAdornment["default"], {
|
|
38
|
+
position: "end"
|
|
39
|
+
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
40
|
+
onClick: onClear,
|
|
41
|
+
size: "small"
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement(_Clear["default"], {
|
|
43
|
+
style: {
|
|
44
|
+
fontSize: '15px'
|
|
33
45
|
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
46
|
+
})));
|
|
47
|
+
};
|
|
36
48
|
|
|
37
49
|
var Select = function Select(_ref) {
|
|
38
50
|
var children = _ref.children,
|
|
@@ -40,11 +52,28 @@ var Select = function Select(_ref) {
|
|
|
40
52
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
41
53
|
margin = _ref.margin,
|
|
42
54
|
padding = _ref.padding,
|
|
55
|
+
hasClear = _ref.hasClear,
|
|
56
|
+
onClear = _ref.onClear,
|
|
43
57
|
_ref$variant = _ref.variant,
|
|
44
58
|
variant = _ref$variant === void 0 ? 'outlined' : _ref$variant,
|
|
45
|
-
otherProps = (0, _objectWithoutProperties2["default"])(_ref, ["children", "style", "margin", "padding", "variant"]);
|
|
59
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_ref, ["children", "style", "margin", "padding", "hasClear", "onClear", "variant"]);
|
|
60
|
+
var useStyles = (0, _styles.makeStyles)(function () {
|
|
61
|
+
return {
|
|
62
|
+
root: {
|
|
63
|
+
padding: "10px 24px 10px ".concat(hasClear ? '20' : '12', "px")
|
|
64
|
+
},
|
|
65
|
+
iconOutlined: hasClear ? _objectSpread(_objectSpread({}, iconStyle), {}, {
|
|
66
|
+
position: 'relative',
|
|
67
|
+
marginLeft: '-20px'
|
|
68
|
+
}) : iconStyle
|
|
69
|
+
};
|
|
70
|
+
});
|
|
46
71
|
var classes = useStyles();
|
|
47
|
-
|
|
72
|
+
var hasValue = !!otherProps.value;
|
|
73
|
+
var endAdornment = hasValue && hasClear ? {
|
|
74
|
+
endAdornment: renderEndAdornment(onClear)
|
|
75
|
+
} : {};
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement(_Select["default"], (0, _extends2["default"])({}, endAdornment, {
|
|
48
77
|
variant: variant,
|
|
49
78
|
classes: {
|
|
50
79
|
root: classes.root,
|
package/core/Sidebar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
import { ButtonProps } from './Button';
|
|
4
|
+
interface SidebarProps extends DefaultProps {
|
|
5
5
|
open: boolean;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
showButton?: boolean;
|
|
@@ -14,8 +14,8 @@ interface IProps extends IDefault {
|
|
|
14
14
|
top?: number | string;
|
|
15
15
|
paperClasses?: object;
|
|
16
16
|
name?: string;
|
|
17
|
-
ButtonProps?:
|
|
17
|
+
ButtonProps?: ButtonProps;
|
|
18
18
|
onToggle: () => void;
|
|
19
19
|
}
|
|
20
|
-
declare const Sidebar: FC<
|
|
20
|
+
declare const Sidebar: FC<SidebarProps>;
|
|
21
21
|
export default Sidebar;
|
package/core/Sidebar.js
CHANGED
|
@@ -115,7 +115,8 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
115
115
|
variant = _ref$variant === void 0 ? 'permanent' : _ref$variant,
|
|
116
116
|
ButtonProps = _ref.ButtonProps,
|
|
117
117
|
onToggle = _ref.onToggle,
|
|
118
|
-
children = _ref.children
|
|
118
|
+
children = _ref.children,
|
|
119
|
+
name = _ref.name;
|
|
119
120
|
var classes = useStyles();
|
|
120
121
|
|
|
121
122
|
var renderAction = function renderAction() {
|
package/core/Slide.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface SlideProps extends DefaultProps {
|
|
4
4
|
in: boolean;
|
|
5
5
|
direction: 'left' | 'right' | 'up' | 'down';
|
|
6
6
|
timeout?: number | {
|
|
@@ -9,5 +9,5 @@ interface IProps extends IDefault {
|
|
|
9
9
|
};
|
|
10
10
|
children?: React.ReactElement<{}>;
|
|
11
11
|
}
|
|
12
|
-
declare const Slide: ({ children, direction, margin, padding, style, ...otherProps }:
|
|
12
|
+
declare const Slide: ({ children, direction, margin, padding, style, ...otherProps }: SlideProps) => JSX.Element;
|
|
13
13
|
export default Slide;
|
package/core/Slider.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { SliderProps } from '@material-ui/core/Slider';
|
|
3
|
-
import {
|
|
4
|
-
interface
|
|
3
|
+
import { DefaultProps } from './types';
|
|
4
|
+
interface ISliderProps {
|
|
5
5
|
defaultValue?: number | number[];
|
|
6
6
|
}
|
|
7
|
-
declare const Slider: FC<Omit<SliderProps, 'defaultValue'> &
|
|
7
|
+
declare const Slider: FC<Omit<SliderProps, 'defaultValue'> & DefaultProps & ISliderProps>;
|
|
8
8
|
export default Slider;
|
package/core/Snackbar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, FC, FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
3
|
import { TransitionProps } from '@material-ui/core/transitions/transition';
|
|
4
|
-
interface
|
|
4
|
+
interface SnackBarProps extends DefaultProps {
|
|
5
5
|
autoHide?: number;
|
|
6
6
|
message: ReactNode;
|
|
7
7
|
open: boolean;
|
|
@@ -21,5 +21,5 @@ interface IProps extends IDefault {
|
|
|
21
21
|
onClose?(): void;
|
|
22
22
|
onClick?(): void;
|
|
23
23
|
}
|
|
24
|
-
declare const SnackBar: FC<
|
|
24
|
+
declare const SnackBar: FC<SnackBarProps>;
|
|
25
25
|
export default SnackBar;
|
package/core/Stepper.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface StepperProps extends DefaultProps {
|
|
4
4
|
active?: number;
|
|
5
5
|
steps: Array<string | TStep>;
|
|
6
6
|
bottomLabel?: boolean;
|
|
@@ -10,7 +10,7 @@ declare type TStep = {
|
|
|
10
10
|
label: JSX.Element | string;
|
|
11
11
|
icon: JSX.Element | ((active?: boolean) => JSX.Element);
|
|
12
12
|
};
|
|
13
|
-
declare class Stepper extends Component<
|
|
13
|
+
declare class Stepper extends Component<StepperProps, {}> {
|
|
14
14
|
static defaultProps: {
|
|
15
15
|
active: number;
|
|
16
16
|
};
|
package/core/Tab.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface TabProps extends DefaultProps {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
icon?: string | JSX.Element;
|
|
6
6
|
label?: string;
|
|
7
7
|
value?: unknown;
|
|
8
8
|
disableRipple?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare class Tab extends Component<
|
|
10
|
+
declare class Tab extends Component<TabProps> {
|
|
11
11
|
static defaultProps: {
|
|
12
12
|
disabled: boolean;
|
|
13
13
|
margin: string;
|
package/core/Table.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TableProps } from '@material-ui/core/Table';
|
|
1
|
+
import { TableProps as MuiTableProps } from '@material-ui/core/Table';
|
|
2
2
|
import { FC } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
interface
|
|
5
|
-
spacing?:
|
|
3
|
+
import { DefaultProps } from './types';
|
|
4
|
+
interface TableProps extends DefaultProps {
|
|
5
|
+
spacing?: MuiTableProps['padding'];
|
|
6
6
|
}
|
|
7
|
-
declare const Table: FC<
|
|
7
|
+
declare const Table: FC<MuiTableProps & TableProps>;
|
|
8
8
|
export default Table;
|
package/core/TableBody.d.ts
CHANGED
package/core/TableCell.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TableCellProps } from '@material-ui/core/TableCell';
|
|
1
|
+
import { TableCellProps as MuiTableCellProps } from '@material-ui/core/TableCell';
|
|
2
2
|
import { FC } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { DefaultProps } from './types';
|
|
4
4
|
import { Omit } from 'ramda';
|
|
5
|
-
interface
|
|
5
|
+
interface TableCellProps extends DefaultProps {
|
|
6
6
|
numeric?: boolean;
|
|
7
7
|
variant?: 'head' | 'body' | 'footer';
|
|
8
|
-
spacing?:
|
|
8
|
+
spacing?: MuiTableCellProps['padding'];
|
|
9
9
|
padding?: number | string;
|
|
10
10
|
align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
|
|
11
11
|
}
|
|
12
|
-
declare const TableCell: FC<Omit<
|
|
12
|
+
declare const TableCell: FC<Omit<MuiTableCellProps, 'padding'> & TableCellProps>;
|
|
13
13
|
export default TableCell;
|
package/core/TableHead.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface TableHeadProps extends DefaultProps, ISort {
|
|
4
4
|
color?: 'primary' | 'secondary' | 'default' | 'inherit';
|
|
5
5
|
classes: {
|
|
6
6
|
default: string;
|
|
@@ -19,5 +19,5 @@ interface ISort {
|
|
|
19
19
|
onSort?(name: string): void;
|
|
20
20
|
}
|
|
21
21
|
export declare const SortContext: React.Context<ISort>;
|
|
22
|
-
declare const _default: React.ComponentType<Pick<React.PropsWithChildren<
|
|
22
|
+
declare const _default: React.ComponentType<Pick<React.PropsWithChildren<TableHeadProps>, "children" | "style" | "padding" | "margin" | "className" | "name" | "id" | "color" | "active" | "direction" | "onSort"> & import("@material-ui/core/styles").StyledComponentProps<"inherit" | "default" | "primary" | "secondary">>;
|
|
23
23
|
export default _default;
|
package/core/TableRow.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TableRowProps } from '@material-ui/core/TableRow';
|
|
1
|
+
import { TableRowProps as MuiTableRowProps } from '@material-ui/core/TableRow';
|
|
2
2
|
import { FC, MouseEvent } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
interface
|
|
3
|
+
import { DefaultProps } from './types';
|
|
4
|
+
interface TableRowProps extends DefaultProps {
|
|
5
5
|
selected?: boolean;
|
|
6
6
|
hover?: boolean;
|
|
7
7
|
background?: string;
|
|
8
8
|
onClick?: (event: MouseEvent<HTMLTableRowElement>) => void;
|
|
9
9
|
}
|
|
10
|
-
declare const TableRow: FC<
|
|
10
|
+
declare const TableRow: FC<MuiTableRowProps & TableRowProps>;
|
|
11
11
|
export default TableRow;
|
package/core/Tabs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
interface TabsProps extends DefaultProps {
|
|
4
4
|
centered?: boolean;
|
|
5
5
|
value: string | number;
|
|
6
6
|
color?: 'default' | 'inherit' | 'primary' | 'secondary';
|
|
@@ -18,5 +18,5 @@ interface IClasses {
|
|
|
18
18
|
indicator: string;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
declare const Tabs: FC<
|
|
21
|
+
declare const Tabs: FC<TabsProps & IClasses>;
|
|
22
22
|
export default Tabs;
|
package/core/TextField.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ChangeEvent, KeyboardEvent, FC, FocusEvent, ReactNode, MouseEvent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
2
|
+
import { DefaultProps } from './types';
|
|
3
|
+
export interface TextFieldProps extends DefaultProps {
|
|
4
4
|
autoComplete?: string;
|
|
5
5
|
autoFocus?: boolean;
|
|
6
6
|
defaultValue?: string | number;
|
|
@@ -26,18 +26,20 @@ export interface IProps extends IDefault {
|
|
|
26
26
|
rowsMax?: string | number;
|
|
27
27
|
helperText?: ReactNode;
|
|
28
28
|
helperIcon?: ReactNode;
|
|
29
|
+
hasClear?: boolean;
|
|
30
|
+
onClear?: () => void;
|
|
29
31
|
onHelperClick?: () => void;
|
|
30
32
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
31
33
|
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
32
34
|
onKeyUp?: (event: KeyboardEvent) => void;
|
|
33
35
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
interface IHelperProps extends Pick<TProps, 'helperIcon'> {
|
|
37
|
+
interface IHelperProps extends Pick<TextFieldProps, 'helperIcon'> {
|
|
37
38
|
onHelperClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
38
39
|
}
|
|
39
|
-
export declare const useStyles: (props?: any) => Record<"input" | "outlinedInput" | "outlinedLabel" | "outlinedMultiline" | "iconOutlined", string>;
|
|
40
40
|
export declare const TextFieldWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
41
|
+
export declare const StaticTextFieldWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
42
|
+
export declare const useStyles: (props?: any) => Record<"input" | "outlinedInput" | "outlinedLabel" | "outlinedMultiline" | "iconOutlined", string>;
|
|
41
43
|
export declare const HelperBox: (props: IHelperProps) => JSX.Element;
|
|
42
|
-
declare const TextField: FC<
|
|
44
|
+
declare const TextField: FC<TextFieldProps>;
|
|
43
45
|
export default TextField;
|