armtek-uikit-react 1.0.154 → 1.0.155
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/index.js +1 -2
- package/lib/const/styles.js +1 -5
- package/lib/helpers/genericForwardRef.js +3 -7
- package/lib/helpers/getColorClasses.js +6 -10
- package/lib/helpers/getSizeClasses.js +5 -9
- package/lib/helpers/getVariantClasses.js +5 -9
- package/lib/helpers/helpers.js +10 -19
- package/lib/helpers/index.js +1 -6
- package/lib/hooks/useClickOutside.js +4 -8
- package/lib/hooks/useEnhancedEffect.js +3 -8
- package/lib/hooks/useEventCallback.js +4 -11
- package/lib/hooks/useLazyRef.js +4 -8
- package/lib/hooks/useTimeout.js +6 -12
- package/lib/services/DateService.js +2 -7
- package/package.json +1 -1
- package/types/theme.js +1 -3
- package/ui/Accordion/Accordion.classes.js +14 -19
- package/ui/Accordion/Accordion.js +35 -38
- package/ui/Accordion/index.d.ts +1 -1
- package/ui/Accordion/index.js +1 -9
- package/ui/Adornment/Adornment.js +11 -16
- package/ui/Adornment/index.js +2 -9
- package/ui/Alert/Alert.js +16 -20
- package/ui/Alert/index.js +1 -8
- package/ui/Avatar/Avatar.js +18 -22
- package/ui/Avatar/index.js +1 -8
- package/ui/AvatarGroup/AvatarGroup.js +14 -18
- package/ui/AvatarGroup/index.js +1 -8
- package/ui/BackDrop/BackDrop.js +9 -13
- package/ui/BackDrop/BackDropBase.js +11 -15
- package/ui/BackDrop/index.js +1 -8
- package/ui/Badge/Badge.js +12 -16
- package/ui/Badge/index.js +1 -8
- package/ui/Button/Button.js +15 -19
- package/ui/Button/index.js +1 -8
- package/ui/ButtonGroup/ButtonGroup.js +10 -15
- package/ui/ButtonGroup/index.js +2 -8
- package/ui/ButtonIcon/ButtonIcon.js +11 -16
- package/ui/ButtonIcon/index.js +1 -8
- package/ui/Card/Card.js +7 -12
- package/ui/Card/index.js +1 -8
- package/ui/Chip/Chip.js +15 -19
- package/ui/Chip/index.js +1 -8
- package/ui/Dropdown/Dropdown.js +16 -20
- package/ui/Dropdown/index.js +1 -8
- package/ui/Form/Checkbox/Checkbox.js +19 -22
- package/ui/Form/Checkbox/index.js +1 -8
- package/ui/Form/DateField/DateField.js +25 -28
- package/ui/Form/DateField/index.js +1 -8
- package/ui/Form/DatePicker/DatePicker.js +13 -21
- package/ui/Form/DatePicker/index.js +1 -8
- package/ui/Form/FormControls/FormControls.js +15 -19
- package/ui/Form/FormControls/index.js +1 -8
- package/ui/Form/Interval/Interval.js +20 -23
- package/ui/Form/Interval/IntervalSlide.js +13 -16
- package/ui/Form/Interval/index.js +2 -9
- package/ui/Form/Password/Password.js +14 -17
- package/ui/Form/Password/index.js +1 -8
- package/ui/Form/Period/Period.js +21 -24
- package/ui/Form/Period/index.js +1 -8
- package/ui/Form/PeriodSelect/PeriodSelect.js +9 -13
- package/ui/Form/PeriodSelect/index.js +1 -8
- package/ui/Form/Radio/Radio.js +8 -13
- package/ui/Form/Radio/index.js +1 -8
- package/ui/Form/Rating/Rating.js +13 -16
- package/ui/Form/Rating/index.js +1 -8
- package/ui/Form/Select/Select.js +49 -50
- package/ui/Form/Select/SelectOptionList.js +8 -13
- package/ui/Form/Select/SelectOptionsContainer.js +6 -11
- package/ui/Form/Select/SelectSummary.js +32 -37
- package/ui/Form/Select/index.js +3 -12
- package/ui/Form/Switch/Switch.js +10 -14
- package/ui/Form/Switch/index.js +1 -8
- package/ui/Form/TextArea/TextArea.js +15 -19
- package/ui/Form/TextArea/index.js +1 -8
- package/ui/Form/TextField/TextField.js +34 -39
- package/ui/Form/TextField/index.js +2 -10
- package/ui/Form/TimeField/TimeField.js +8 -13
- package/ui/Form/TimeField/index.js +1 -8
- package/ui/Form/TimePicker/TimePicker.js +8 -12
- package/ui/Form/TimePicker/index.js +1 -8
- package/ui/HelperText/HelperText.js +7 -12
- package/ui/HelperText/index.js +1 -8
- package/ui/Icon/Icon.js +9 -14
- package/ui/Icon/Mi.js +10 -15
- package/ui/Icon/Mis.js +7 -11
- package/ui/Icon/index.js +3 -11
- package/ui/Link/Link.js +7 -12
- package/ui/Link/index.js +1 -8
- package/ui/List/ListItem.js +20 -26
- package/ui/List/index.js +1 -8
- package/ui/Loader/Loader.js +7 -12
- package/ui/Loader/index.js +1 -8
- package/ui/Logo/Logo.js +25 -29
- package/ui/Logo/index.js +1 -8
- package/ui/Modal/BaseModal.js +24 -28
- package/ui/Modal/Modal.js +8 -13
- package/ui/Modal/index.js +1 -8
- package/ui/Pagination/Pagination.js +36 -39
- package/ui/Pagination/index.js +1 -8
- package/ui/Paper/Paper.js +7 -12
- package/ui/Paper/index.js +1 -8
- package/ui/Popover/Popover.js +11 -16
- package/ui/Popover/index.js +1 -8
- package/ui/Popper/Popper.js +8 -12
- package/ui/Popper/PopperBase.js +11 -14
- package/ui/Popper/index.js +2 -9
- package/ui/Skeleton/Skeleton.js +5 -11
- package/ui/Skeleton/index.js +1 -8
- package/ui/Slider/RcSlider.js +0 -1
- package/ui/Slider/Slider.js +15 -19
- package/ui/Slider/index.js +1 -8
- package/ui/Stack/Stack.js +12 -17
- package/ui/Stack/index.js +1 -8
- package/ui/Status/Status.js +11 -15
- package/ui/Status/index.js +1 -8
- package/ui/Stepper/StepItem.js +18 -22
- package/ui/Stepper/StepItemIcon.js +11 -16
- package/ui/Stepper/Stepper.js +13 -17
- package/ui/Stepper/index.js +1 -8
- package/ui/Table/Table.js +17 -19
- package/ui/Table/TableBase.js +6 -11
- package/ui/Table/TableCell.js +10 -15
- package/ui/Table/TableRow.js +8 -13
- package/ui/Table/index.js +3 -10
- package/ui/Tooltip/Tooltip.js +20 -23
- package/ui/Tooltip/index.js +1 -8
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.SelectOptionsContainer = void 0;
|
|
6
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
const SelectOptionsContainer = exports.SelectOptionsContainer = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export const SelectOptionsContainer = /*#__PURE__*/forwardRef(({
|
|
10
5
|
inline,
|
|
11
6
|
children
|
|
12
7
|
}, ref) => {
|
|
13
|
-
return /*#__PURE__*/(
|
|
8
|
+
return /*#__PURE__*/_jsx("div", {
|
|
14
9
|
ref: ref,
|
|
15
|
-
className: (
|
|
10
|
+
className: clsx('arm-options', {
|
|
16
11
|
'arm-options_inline': !!inline
|
|
17
12
|
}),
|
|
18
13
|
children: children
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _Select = require("./Select");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
const SelectSummary = props => {
|
|
1
|
+
import Badge from "../../Badge";
|
|
2
|
+
import Button from "../../Button";
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import Chip from "../../Chip";
|
|
5
|
+
import { getOptionValue } from "./Select";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
export const SelectSummary = props => {
|
|
13
10
|
let {
|
|
14
11
|
label_check_all = 'Выбрать все',
|
|
15
12
|
label_uncheck_all = 'Очистить все',
|
|
@@ -23,59 +20,59 @@ const SelectSummary = props => {
|
|
|
23
20
|
disabled
|
|
24
21
|
} = props;
|
|
25
22
|
let valueArr = value ? Array.isArray(value) ? value : [value] : [];
|
|
26
|
-
let selectedOptions = options.filter(item => valueArr.includes(
|
|
23
|
+
let selectedOptions = options.filter(item => valueArr.includes(getOptionValue(item)));
|
|
27
24
|
let selectAllDisabled = disabled || selectedOptions.length === options.length;
|
|
28
25
|
let resetAllDisabled = disabled || selectedOptions.length === 0;
|
|
29
|
-
return /*#__PURE__*/(
|
|
30
|
-
children: /*#__PURE__*/(
|
|
26
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
27
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
31
28
|
className: 'arm-selectSummary',
|
|
32
|
-
children: [selectedOptions.length > 0 && /*#__PURE__*/(
|
|
29
|
+
children: [selectedOptions.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
33
30
|
className: 'arm-selectSummary__options',
|
|
34
|
-
children: /*#__PURE__*/(
|
|
31
|
+
children: /*#__PURE__*/_jsx(SelectSummaryChips, {
|
|
35
32
|
options: selectedOptions,
|
|
36
33
|
onDelete: onClose,
|
|
37
34
|
disabled: disabled
|
|
38
35
|
})
|
|
39
|
-
}), /*#__PURE__*/(
|
|
36
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
40
37
|
className: 'arm-selectSummary__row',
|
|
41
|
-
children: [!!onSelectAll && /*#__PURE__*/(
|
|
42
|
-
className: (
|
|
38
|
+
children: [!!onSelectAll && /*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: clsx('arm-selectSummary__check', {
|
|
43
40
|
'arm-selectSummary__check_disabled': selectAllDisabled
|
|
44
41
|
}),
|
|
45
|
-
children: /*#__PURE__*/(
|
|
42
|
+
children: /*#__PURE__*/_jsx(Badge, {
|
|
46
43
|
badgeText: options.length,
|
|
47
44
|
shape: 'square',
|
|
48
45
|
color: 'info',
|
|
49
46
|
position: 'center-right',
|
|
50
|
-
children: /*#__PURE__*/(
|
|
47
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
51
48
|
className: 'arm-selectSummary__checkLabel',
|
|
52
49
|
onClick: onSelectAll,
|
|
53
50
|
children: label_check_all
|
|
54
51
|
})
|
|
55
52
|
})
|
|
56
|
-
}), !!onClear && /*#__PURE__*/(
|
|
57
|
-
className: (
|
|
53
|
+
}), !!onClear && /*#__PURE__*/_jsx("div", {
|
|
54
|
+
className: clsx('arm-selectSummary__check', {
|
|
58
55
|
'arm-selectSummary__check_disabled': resetAllDisabled
|
|
59
56
|
}),
|
|
60
|
-
children: /*#__PURE__*/(
|
|
57
|
+
children: /*#__PURE__*/_jsx(Badge, {
|
|
61
58
|
badgeText: selectedOptions.length,
|
|
62
59
|
shape: 'square',
|
|
63
60
|
color: 'info',
|
|
64
61
|
position: 'center-right',
|
|
65
|
-
children: /*#__PURE__*/(
|
|
62
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
66
63
|
className: 'arm-selectSummary__checkLabel',
|
|
67
64
|
onClick: onClear,
|
|
68
65
|
children: label_uncheck_all
|
|
69
66
|
})
|
|
70
67
|
})
|
|
71
|
-
}), !!onSubmit && /*#__PURE__*/(
|
|
72
|
-
children: /*#__PURE__*/(
|
|
68
|
+
}), !!onSubmit && /*#__PURE__*/_jsx("div", {
|
|
69
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
73
70
|
className: 'arm-selectSummary__button',
|
|
74
71
|
disabled: disabled,
|
|
75
72
|
variant: 'transparent',
|
|
76
73
|
size: 'small',
|
|
77
74
|
onClick: onSubmit,
|
|
78
|
-
children: /*#__PURE__*/(
|
|
75
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
79
76
|
children: label_submit
|
|
80
77
|
})
|
|
81
78
|
})
|
|
@@ -84,25 +81,23 @@ const SelectSummary = props => {
|
|
|
84
81
|
})
|
|
85
82
|
});
|
|
86
83
|
};
|
|
87
|
-
|
|
88
|
-
const SelectSummaryChips = props => {
|
|
84
|
+
export const SelectSummaryChips = props => {
|
|
89
85
|
let {
|
|
90
86
|
options,
|
|
91
87
|
onDelete,
|
|
92
88
|
disabled
|
|
93
89
|
} = props;
|
|
94
|
-
return /*#__PURE__*/(
|
|
95
|
-
children: /*#__PURE__*/(
|
|
90
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
91
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
96
92
|
className: 'arm-selectSummary__optionList',
|
|
97
93
|
children: options.map(option => {
|
|
98
|
-
return /*#__PURE__*/(
|
|
94
|
+
return /*#__PURE__*/_jsx(Chip, {
|
|
99
95
|
disabled: disabled,
|
|
100
96
|
className: 'arm-selectSummary__option',
|
|
101
97
|
text: option.text,
|
|
102
98
|
onClose: e => onDelete(e, option)
|
|
103
|
-
},
|
|
99
|
+
}, getOptionValue(option));
|
|
104
100
|
})
|
|
105
101
|
})
|
|
106
102
|
});
|
|
107
|
-
};
|
|
108
|
-
exports.SelectSummaryChips = SelectSummaryChips;
|
|
103
|
+
};
|
package/ui/Form/Select/index.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.default = exports.SelectSummaryChips = exports.SelectSummary = exports.SelectOptions = void 0;
|
|
5
|
-
var _Select = _interopRequireWildcard(require("./Select"));
|
|
6
|
-
exports.default = _Select.default;
|
|
7
|
-
exports.SelectOptions = _Select.SelectOptions;
|
|
8
|
-
var _SelectSummary = require("./SelectSummary");
|
|
9
|
-
exports.SelectSummary = _SelectSummary.SelectSummary;
|
|
10
|
-
exports.SelectSummaryChips = _SelectSummary.SelectSummaryChips;
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
export { default } from "./Select";
|
|
2
|
+
export { SelectOptions } from "./Select";
|
|
3
|
+
export { SelectSummary, SelectSummaryChips } from "./SelectSummary";
|
package/ui/Form/Switch/Switch.js
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
7
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
5
|
const Switch = props => {
|
|
9
6
|
let {
|
|
10
7
|
size,
|
|
11
8
|
...restProps
|
|
12
9
|
} = props;
|
|
13
|
-
return /*#__PURE__*/(
|
|
14
|
-
children: /*#__PURE__*/(
|
|
15
|
-
className: (
|
|
16
|
-
children: [/*#__PURE__*/(
|
|
10
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
11
|
+
children: /*#__PURE__*/_jsxs("label", {
|
|
12
|
+
className: clsx('arm-switch', ['arm-switch_' + props.size]),
|
|
13
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
17
14
|
className: 'arm-switch__input',
|
|
18
15
|
...restProps,
|
|
19
16
|
type: "checkbox"
|
|
20
|
-
}), /*#__PURE__*/(
|
|
17
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
21
18
|
className: 'arm-switch__slider'
|
|
22
19
|
})]
|
|
23
20
|
})
|
|
24
21
|
});
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
module.exports = exports.default;
|
|
23
|
+
export default Switch;
|
package/ui/Form/Switch/index.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _Switch = _interopRequireDefault(require("./Switch"));
|
|
7
|
-
exports.default = _Switch.default;
|
|
8
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./Switch";
|
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
const TextArea = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
3
|
+
import TextField from "../TextField/TextField";
|
|
4
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
9
|
var _textareaRef$current, _textareaRef$current2;
|
|
13
10
|
let {
|
|
14
11
|
onChange,
|
|
15
12
|
className,
|
|
16
13
|
...restProps
|
|
17
14
|
} = props;
|
|
18
|
-
let [value, setValue] =
|
|
19
|
-
let [minHeight, setMinHeight] =
|
|
20
|
-
let textareaRef =
|
|
21
|
-
|
|
15
|
+
let [value, setValue] = useState('');
|
|
16
|
+
let [minHeight, setMinHeight] = useState(0);
|
|
17
|
+
let textareaRef = useRef();
|
|
18
|
+
useImperativeHandle(ref, () => {
|
|
22
19
|
return textareaRef.current;
|
|
23
20
|
}, []);
|
|
24
21
|
const handleChange = e => {
|
|
25
22
|
setValue(e.target.value);
|
|
26
23
|
if (onChange) onChange(e);
|
|
27
24
|
};
|
|
28
|
-
|
|
25
|
+
useEffect(() => {
|
|
29
26
|
if (textareaRef.current) setMinHeight(textareaRef.current.clientHeight);
|
|
30
27
|
}, [textareaRef]);
|
|
31
28
|
let textHeight = (((_textareaRef$current = textareaRef.current) == null ? void 0 : _textareaRef$current.scrollHeight) || 0) < minHeight ? minHeight : (_textareaRef$current2 = textareaRef.current) == null ? void 0 : _textareaRef$current2.scrollHeight;
|
|
32
|
-
return /*#__PURE__*/(
|
|
33
|
-
children: /*#__PURE__*/(
|
|
29
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
30
|
+
children: /*#__PURE__*/_jsx(TextField, {
|
|
34
31
|
ref: textareaRef,
|
|
35
32
|
value: value,
|
|
36
33
|
...restProps,
|
|
37
|
-
className: (
|
|
34
|
+
className: clsx('arm-textarea', ['arm-textarea_size_' + restProps.size], className),
|
|
38
35
|
onChange: handleChange,
|
|
39
36
|
multiline: true,
|
|
40
37
|
classes: {
|
|
@@ -47,5 +44,4 @@ const TextArea = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
47
44
|
})
|
|
48
45
|
});
|
|
49
46
|
});
|
|
50
|
-
|
|
51
|
-
module.exports = exports.default;
|
|
47
|
+
export default TextArea;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _TextArea = _interopRequireDefault(require("./TextArea"));
|
|
7
|
-
exports.default = _TextArea.default;
|
|
8
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./TextArea";
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
const TextField = exports.TextField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
3
|
+
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import HelperText from "../../HelperText/HelperText";
|
|
6
|
+
import Adornment, { AdornmentContainer } from "../../Adornment";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
export const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
11
|
var _inputRef$current;
|
|
16
12
|
let {
|
|
17
13
|
error,
|
|
@@ -28,10 +24,10 @@ const TextField = exports.TextField = /*#__PURE__*/(0, _react.forwardRef)((props
|
|
|
28
24
|
WrapperProps,
|
|
29
25
|
...inputProps
|
|
30
26
|
} = props;
|
|
31
|
-
let [focused, setFocused] =
|
|
32
|
-
const inputRef =
|
|
27
|
+
let [focused, setFocused] = useState(false);
|
|
28
|
+
const inputRef = useRef(null);
|
|
33
29
|
const currentScrollHeight = (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.scrollHeight;
|
|
34
|
-
|
|
30
|
+
useImperativeHandle(ref, () => {
|
|
35
31
|
return inputRef.current;
|
|
36
32
|
// return {
|
|
37
33
|
// scrollHeight: currentScrollHeight,
|
|
@@ -52,23 +48,23 @@ const TextField = exports.TextField = /*#__PURE__*/(0, _react.forwardRef)((props
|
|
|
52
48
|
setFocused(false);
|
|
53
49
|
if (inputProps.onBlur) inputProps.onBlur(e);
|
|
54
50
|
};
|
|
55
|
-
let endContent = /*#__PURE__*/(
|
|
51
|
+
let endContent = /*#__PURE__*/_jsxs(AdornmentContainer, {
|
|
56
52
|
className: 'arm-textfield__adornment',
|
|
57
|
-
children: [endAdornment, error && /*#__PURE__*/(
|
|
58
|
-
className: (
|
|
53
|
+
children: [endAdornment, error && /*#__PURE__*/_jsx(Adornment, {
|
|
54
|
+
className: clsx('material_icon', 'text-error'),
|
|
59
55
|
children: "error_outline"
|
|
60
|
-
}), success && /*#__PURE__*/(
|
|
61
|
-
className: (
|
|
56
|
+
}), success && /*#__PURE__*/_jsx(Adornment, {
|
|
57
|
+
className: clsx('material_icon', 'text-success'),
|
|
62
58
|
children: "done"
|
|
63
59
|
})]
|
|
64
60
|
});
|
|
65
61
|
let endContentExists = endAdornment || error || success;
|
|
66
62
|
let Component = multiline ? 'textarea' : 'input';
|
|
67
63
|
let realFocused = props.focused !== undefined ? props.focused : focused;
|
|
68
|
-
return /*#__PURE__*/(
|
|
69
|
-
children: /*#__PURE__*/(
|
|
64
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
65
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
70
66
|
className: className,
|
|
71
|
-
children: [/*#__PURE__*/(
|
|
67
|
+
children: [/*#__PURE__*/_jsxs(TextFieldContainer, {
|
|
72
68
|
size: size,
|
|
73
69
|
variant: variant,
|
|
74
70
|
disabled: inputProps.disabled,
|
|
@@ -79,7 +75,7 @@ const TextField = exports.TextField = /*#__PURE__*/(0, _react.forwardRef)((props
|
|
|
79
75
|
},
|
|
80
76
|
error: error,
|
|
81
77
|
className: classes == null ? void 0 : classes.root,
|
|
82
|
-
children: [/*#__PURE__*/(
|
|
78
|
+
children: [/*#__PURE__*/_jsx(TextFieldInput, {
|
|
83
79
|
WrapperProps: WrapperProps,
|
|
84
80
|
wrapperClass: classes == null ? void 0 : classes.wrapper,
|
|
85
81
|
className: classes == null ? void 0 : classes.input,
|
|
@@ -95,7 +91,7 @@ const TextField = exports.TextField = /*#__PURE__*/(0, _react.forwardRef)((props
|
|
|
95
91
|
onFocus: handleFocus,
|
|
96
92
|
onBlur: handleBlur
|
|
97
93
|
}), endContentExists && endContent]
|
|
98
|
-
}), helperText && /*#__PURE__*/(
|
|
94
|
+
}), helperText && /*#__PURE__*/_jsx(HelperText, {
|
|
99
95
|
className: 'arm-textfield__helperText',
|
|
100
96
|
error: error,
|
|
101
97
|
children: helperText
|
|
@@ -103,7 +99,7 @@ const TextField = exports.TextField = /*#__PURE__*/(0, _react.forwardRef)((props
|
|
|
103
99
|
})
|
|
104
100
|
});
|
|
105
101
|
});
|
|
106
|
-
const TextFieldContainer = props => {
|
|
102
|
+
export const TextFieldContainer = props => {
|
|
107
103
|
let {
|
|
108
104
|
focused,
|
|
109
105
|
disabled,
|
|
@@ -114,10 +110,10 @@ const TextFieldContainer = props => {
|
|
|
114
110
|
error,
|
|
115
111
|
...restProps
|
|
116
112
|
} = props;
|
|
117
|
-
return /*#__PURE__*/(
|
|
118
|
-
children: /*#__PURE__*/(
|
|
113
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
114
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
119
115
|
...restProps,
|
|
120
|
-
className: (
|
|
116
|
+
className: clsx('TextFieldContrainer', 'arm-textfield_root', ['arm-textfield_root_' + variant], ['arm-textfield_root_size_' + size], {
|
|
121
117
|
'arm-textfield_root_focused': focused,
|
|
122
118
|
'arm-textfield_root_disabled': disabled,
|
|
123
119
|
'arm-textfield_root_error': error
|
|
@@ -126,8 +122,7 @@ const TextFieldContainer = props => {
|
|
|
126
122
|
})
|
|
127
123
|
});
|
|
128
124
|
};
|
|
129
|
-
|
|
130
|
-
const TextFieldInput = exports.TextFieldInput = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
125
|
+
export const TextFieldInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
131
126
|
var _ref$current;
|
|
132
127
|
let {
|
|
133
128
|
Component = 'input',
|
|
@@ -145,25 +140,25 @@ const TextFieldInput = exports.TextFieldInput = /*#__PURE__*/(0, _react.forwardR
|
|
|
145
140
|
const handleWheel = e => {
|
|
146
141
|
if (inputProps.type === 'number' && e.target instanceof HTMLElement) e.target.blur();else if (props.onWheel) props.onWheel(e);
|
|
147
142
|
};
|
|
148
|
-
return /*#__PURE__*/(
|
|
149
|
-
children: /*#__PURE__*/(
|
|
143
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
144
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
150
145
|
...WrapperProps,
|
|
151
|
-
className: (
|
|
146
|
+
className: clsx('arm-textfield__wrapper', ['arm-textfield__wrapper_size_' + size], wrapperClass, {
|
|
152
147
|
'arm-textfield__wrapper_label': !!label,
|
|
153
148
|
'arm-textfield__wrapper_outlined': variant === 'outlined'
|
|
154
149
|
}),
|
|
155
|
-
children: [/*#__PURE__*/(
|
|
150
|
+
children: [/*#__PURE__*/_jsx(Component, {
|
|
156
151
|
ref: ref,
|
|
157
152
|
...inputProps,
|
|
158
153
|
onWheel: handleWheel,
|
|
159
|
-
className: (
|
|
154
|
+
className: clsx('arm-textfield__input', ['arm-textfield__input_size_' + size], ['arm-textfield__input_' + variant], {
|
|
160
155
|
'arm-textfield__input_label': !!label,
|
|
161
156
|
'arm-textfield_focused': focused,
|
|
162
157
|
'arm-textfield_error': !!error,
|
|
163
158
|
'arm-textarea': multiline
|
|
164
159
|
}, className)
|
|
165
|
-
}), label && /*#__PURE__*/(
|
|
166
|
-
className: (
|
|
160
|
+
}), label && /*#__PURE__*/_jsx("span", {
|
|
161
|
+
className: clsx('arm-textfield__label', {
|
|
167
162
|
'arm-textfield__label_focused': focused || !!props.value || !!((_ref$current = ref.current) != null && _ref$current.value),
|
|
168
163
|
'arm-textfield__label_small': size === 'small',
|
|
169
164
|
'arm-textfield__label_error': error
|
|
@@ -173,4 +168,4 @@ const TextFieldInput = exports.TextFieldInput = /*#__PURE__*/(0, _react.forwardR
|
|
|
173
168
|
})
|
|
174
169
|
});
|
|
175
170
|
});
|
|
176
|
-
|
|
171
|
+
export default TextField;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.TextFieldInput = exports.TextFieldContainer = void 0;
|
|
5
|
-
var _TextField = _interopRequireWildcard(require("./TextField"));
|
|
6
|
-
exports.default = _TextField.default;
|
|
7
|
-
exports.TextFieldInput = _TextField.TextFieldInput;
|
|
8
|
-
exports.TextFieldContainer = _TextField.TextFieldContainer;
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
export { default } from "./TextField";
|
|
2
|
+
export { TextFieldInput, TextFieldContainer } from "./TextField";
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
const TimeField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
10
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
11
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateField.default, {
|
|
1
|
+
import DateField from "../DateField/DateField";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
const TimeField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
6
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
7
|
+
children: /*#__PURE__*/_jsx(DateField, {
|
|
12
8
|
...props,
|
|
13
9
|
showTime: true,
|
|
14
10
|
ref: ref,
|
|
@@ -17,5 +13,4 @@ const TimeField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
17
13
|
})
|
|
18
14
|
});
|
|
19
15
|
});
|
|
20
|
-
|
|
21
|
-
module.exports = exports.default;
|
|
16
|
+
export default TimeField;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _TimeField = _interopRequireDefault(require("./TimeField"));
|
|
7
|
-
exports.default = _TimeField.default;
|
|
8
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./TimeField";
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
import DatePicker from "../DatePicker/DatePicker";
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
7
|
const TimePicker = () => {
|
|
11
|
-
const [startDate, setStartDate] =
|
|
8
|
+
const [startDate, setStartDate] = useState(new Date());
|
|
12
9
|
const handleChange = date => {
|
|
13
10
|
setStartDate(date);
|
|
14
11
|
};
|
|
15
|
-
return /*#__PURE__*/(
|
|
16
|
-
children: /*#__PURE__*/(
|
|
12
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
13
|
+
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
17
14
|
selected: startDate,
|
|
18
15
|
onChange: handleChange,
|
|
19
16
|
timeIntervals: 5,
|
|
@@ -23,5 +20,4 @@ const TimePicker = () => {
|
|
|
23
20
|
})
|
|
24
21
|
});
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
module.exports = exports.default;
|
|
23
|
+
export default TimePicker;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _TimePicker = _interopRequireDefault(require("./TimePicker"));
|
|
7
|
-
exports.default = _TimePicker.default;
|
|
8
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./TimePicker";
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
7
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
4
|
const HelperText = props => {
|
|
9
5
|
let {
|
|
10
6
|
className,
|
|
@@ -12,15 +8,14 @@ const HelperText = props => {
|
|
|
12
8
|
children,
|
|
13
9
|
...restProps
|
|
14
10
|
} = props;
|
|
15
|
-
return /*#__PURE__*/(
|
|
16
|
-
children: /*#__PURE__*/(
|
|
11
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
12
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
17
13
|
...restProps,
|
|
18
|
-
className: (
|
|
14
|
+
className: clsx('arm-helper-text', {
|
|
19
15
|
'arm-helper-text_error': !!error
|
|
20
16
|
}, className),
|
|
21
17
|
children: children
|
|
22
18
|
})
|
|
23
19
|
});
|
|
24
20
|
};
|
|
25
|
-
|
|
26
|
-
module.exports = exports.default;
|
|
21
|
+
export default HelperText;
|
package/ui/HelperText/index.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _HelperText = _interopRequireDefault(require("./HelperText"));
|
|
7
|
-
exports.default = _HelperText.default;
|
|
8
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./HelperText";
|