armtek-uikit-react 1.0.153 → 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.d.ts +1 -1
- package/lib/helpers/index.js +1 -9
- 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 -16
- 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.d.ts +1 -1
- package/ui/Alert/index.js +1 -16
- package/ui/Avatar/Avatar.js +18 -22
- package/ui/Avatar/index.d.ts +1 -1
- package/ui/Avatar/index.js +1 -16
- package/ui/AvatarGroup/AvatarGroup.js +14 -18
- package/ui/AvatarGroup/index.d.ts +1 -1
- package/ui/AvatarGroup/index.js +1 -16
- package/ui/BackDrop/BackDrop.js +9 -13
- package/ui/BackDrop/BackDropBase.js +11 -15
- package/ui/BackDrop/index.d.ts +0 -1
- package/ui/BackDrop/index.js +1 -16
- package/ui/Badge/Badge.js +12 -16
- package/ui/Badge/index.d.ts +1 -2
- package/ui/Badge/index.js +1 -16
- package/ui/Button/Button.js +15 -19
- package/ui/Button/index.d.ts +1 -1
- package/ui/Button/index.js +1 -16
- package/ui/ButtonGroup/ButtonGroup.js +10 -15
- package/ui/ButtonGroup/index.d.ts +1 -1
- package/ui/ButtonGroup/index.js +2 -16
- package/ui/ButtonIcon/ButtonIcon.js +11 -16
- package/ui/ButtonIcon/index.d.ts +1 -1
- package/ui/ButtonIcon/index.js +1 -16
- package/ui/Card/Card.js +7 -12
- package/ui/Card/index.d.ts +1 -1
- package/ui/Card/index.js +1 -16
- package/ui/Chip/Chip.js +15 -19
- package/ui/Chip/index.d.ts +1 -1
- package/ui/Chip/index.js +1 -16
- package/ui/Dropdown/Dropdown.js +16 -20
- package/ui/Dropdown/index.d.ts +1 -1
- package/ui/Dropdown/index.js +1 -16
- package/ui/Form/Checkbox/Checkbox.js +19 -22
- package/ui/Form/Checkbox/index.d.ts +1 -1
- package/ui/Form/Checkbox/index.js +1 -16
- package/ui/Form/DateField/DateField.js +25 -28
- package/ui/Form/DateField/index.d.ts +1 -1
- package/ui/Form/DateField/index.js +1 -16
- package/ui/Form/DatePicker/DatePicker.js +13 -21
- package/ui/Form/DatePicker/index.d.ts +1 -1
- package/ui/Form/DatePicker/index.js +1 -16
- package/ui/Form/FormControls/FormControls.js +15 -19
- package/ui/Form/FormControls/index.d.ts +1 -1
- package/ui/Form/FormControls/index.js +1 -16
- package/ui/Form/Interval/Interval.js +20 -23
- package/ui/Form/Interval/IntervalSlide.js +13 -16
- package/ui/Form/Interval/index.d.ts +1 -1
- package/ui/Form/Interval/index.js +2 -20
- package/ui/Form/Password/Password.js +14 -17
- package/ui/Form/Password/index.d.ts +0 -1
- package/ui/Form/Password/index.js +1 -16
- package/ui/Form/Period/Period.js +21 -24
- package/ui/Form/Period/index.d.ts +1 -1
- package/ui/Form/Period/index.js +1 -16
- package/ui/Form/PeriodSelect/PeriodSelect.js +9 -13
- package/ui/Form/PeriodSelect/index.d.ts +0 -1
- package/ui/Form/PeriodSelect/index.js +1 -16
- package/ui/Form/Radio/Radio.js +8 -13
- package/ui/Form/Radio/index.d.ts +0 -1
- package/ui/Form/Radio/index.js +1 -16
- package/ui/Form/Rating/Rating.js +13 -16
- package/ui/Form/Rating/index.d.ts +0 -1
- package/ui/Form/Rating/index.js +1 -16
- 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.d.ts +2 -2
- package/ui/Form/Select/index.js +3 -23
- package/ui/Form/Switch/Switch.js +10 -14
- package/ui/Form/Switch/index.d.ts +0 -1
- package/ui/Form/Switch/index.js +1 -16
- package/ui/Form/TextArea/TextArea.js +15 -19
- package/ui/Form/TextArea/index.d.ts +1 -1
- package/ui/Form/TextArea/index.js +1 -16
- package/ui/Form/TextField/TextField.js +34 -39
- package/ui/Form/TextField/index.d.ts +1 -1
- package/ui/Form/TextField/index.js +2 -11
- package/ui/Form/TimeField/TimeField.js +8 -13
- package/ui/Form/TimeField/index.d.ts +0 -1
- package/ui/Form/TimeField/index.js +1 -16
- package/ui/Form/TimePicker/TimePicker.js +8 -12
- package/ui/Form/TimePicker/index.d.ts +0 -1
- package/ui/Form/TimePicker/index.js +1 -16
- package/ui/HelperText/HelperText.js +7 -12
- package/ui/HelperText/index.d.ts +0 -1
- package/ui/HelperText/index.js +1 -16
- 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.d.ts +1 -1
- package/ui/Icon/index.js +3 -22
- package/ui/Link/Link.js +7 -12
- package/ui/Link/index.d.ts +1 -1
- package/ui/Link/index.js +1 -16
- package/ui/List/ListItem.js +20 -26
- package/ui/List/index.d.ts +1 -1
- package/ui/List/index.js +1 -16
- package/ui/Loader/Loader.js +7 -12
- package/ui/Loader/index.d.ts +1 -1
- package/ui/Loader/index.js +1 -16
- package/ui/Logo/Logo.js +25 -29
- package/ui/Logo/index.d.ts +1 -1
- package/ui/Logo/index.js +1 -16
- package/ui/Modal/BaseModal.js +24 -28
- package/ui/Modal/Modal.js +8 -13
- package/ui/Modal/index.d.ts +1 -1
- package/ui/Modal/index.js +1 -16
- package/ui/Pagination/Pagination.js +36 -39
- package/ui/Pagination/index.d.ts +1 -1
- package/ui/Pagination/index.js +1 -16
- package/ui/Paper/Paper.js +7 -12
- package/ui/Paper/index.d.ts +1 -1
- package/ui/Paper/index.js +1 -16
- package/ui/Popover/Popover.js +11 -16
- package/ui/Popover/index.d.ts +1 -1
- package/ui/Popover/index.js +1 -16
- package/ui/Popper/Popper.js +8 -12
- package/ui/Popper/PopperBase.js +11 -14
- package/ui/Popper/index.d.ts +1 -1
- package/ui/Popper/index.js +2 -16
- package/ui/Skeleton/Skeleton.js +5 -11
- package/ui/Skeleton/index.d.ts +0 -1
- package/ui/Skeleton/index.js +1 -16
- package/ui/Slider/RcSlider.js +0 -1
- package/ui/Slider/Slider.js +15 -19
- package/ui/Slider/index.d.ts +1 -1
- package/ui/Slider/index.js +1 -16
- package/ui/Stack/Stack.js +12 -17
- package/ui/Stack/index.d.ts +1 -1
- package/ui/Stack/index.js +1 -16
- package/ui/Status/Status.js +11 -15
- package/ui/Status/index.d.ts +0 -1
- package/ui/Status/index.js +1 -16
- 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.d.ts +1 -1
- package/ui/Stepper/index.js +1 -16
- 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.d.ts +1 -1
- package/ui/Tooltip/index.js +1 -16
package/ui/Form/Rating/index.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
var _exportNames = {};
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _Rating = _interopRequireWildcard(require("./Rating"));
|
|
7
|
-
exports.default = _Rating.default;
|
|
8
|
-
Object.keys(_Rating).forEach(function (key) {
|
|
9
|
-
if (key === "default" || key === "__esModule") return;
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
11
|
-
if (key in exports && exports[key] === _Rating[key]) return;
|
|
12
|
-
exports[key] = _Rating[key];
|
|
13
|
-
});
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./Rating";
|
package/ui/Form/Select/Select.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const getOptionValue = option => option.value || option.text;
|
|
3
|
+
import TextField from "../TextField/TextField";
|
|
4
|
+
import { forwardRef, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import useClickOutside from "../../../lib/hooks/useClickOutside";
|
|
7
|
+
import ButtonIcon from "../../ButtonIcon";
|
|
8
|
+
import Adornment from "../../Adornment";
|
|
9
|
+
import { SelectSummary, SelectSummaryChips } from "./SelectSummary";
|
|
10
|
+
import Popover from "../../Popover/Popover";
|
|
11
|
+
import { fixedForwardRef } from "../../../lib/helpers";
|
|
12
|
+
import { SelectOptionsContainer } from "./SelectOptionsContainer";
|
|
13
|
+
import { SelectOptionList } from "./SelectOptionList";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
export const getOptionValue = option => option.value || option.text;
|
|
20
18
|
|
|
21
19
|
// let selectEl!: HTMLSelectElement
|
|
22
|
-
|
|
20
|
+
|
|
23
21
|
function Select(props, ref) {
|
|
24
22
|
var _options$find;
|
|
25
23
|
let {
|
|
@@ -46,12 +44,12 @@ function Select(props, ref) {
|
|
|
46
44
|
query,
|
|
47
45
|
...inputProps
|
|
48
46
|
} = props;
|
|
49
|
-
let [active, setActive] =
|
|
50
|
-
let [selected, setSelected] =
|
|
51
|
-
let [focused, setFocused] =
|
|
52
|
-
let [q, setQ] =
|
|
53
|
-
const anchorEl =
|
|
54
|
-
const inlineOptRef = (
|
|
47
|
+
let [active, setActive] = useState(!!defaultOpen);
|
|
48
|
+
let [selected, setSelected] = useState(defaultValue || (multiple ? [] : ''));
|
|
49
|
+
let [focused, setFocused] = useState(false);
|
|
50
|
+
let [q, setQ] = useState('');
|
|
51
|
+
const anchorEl = useRef(null);
|
|
52
|
+
const inlineOptRef = useClickOutside(handleClose);
|
|
55
53
|
const handleOpen = () => {
|
|
56
54
|
if (!inputProps.disabled) {
|
|
57
55
|
setActive(true);
|
|
@@ -136,16 +134,16 @@ function Select(props, ref) {
|
|
|
136
134
|
if (onClose) onClose();else setActive(false);
|
|
137
135
|
}
|
|
138
136
|
let displayClear = clear && (multiple ? realValue && realValue.length > 0 : !!realValue);
|
|
139
|
-
let selectEndAdornment = /*#__PURE__*/(
|
|
140
|
-
children: [/*#__PURE__*/(
|
|
137
|
+
let selectEndAdornment = /*#__PURE__*/_jsxs(_Fragment, {
|
|
138
|
+
children: [/*#__PURE__*/_jsx(Adornment, {
|
|
141
139
|
children: endAdornment
|
|
142
|
-
}), displayClear && /*#__PURE__*/(
|
|
143
|
-
children: /*#__PURE__*/(
|
|
140
|
+
}), displayClear && /*#__PURE__*/_jsx(Adornment, {
|
|
141
|
+
children: /*#__PURE__*/_jsx(ButtonIcon, {
|
|
144
142
|
size: 'small',
|
|
145
143
|
onClick: handleResetAll,
|
|
146
144
|
mi: 'close'
|
|
147
145
|
})
|
|
148
|
-
}), /*#__PURE__*/(
|
|
146
|
+
}), /*#__PURE__*/_jsx(ButtonIcon, {
|
|
149
147
|
size: 'small',
|
|
150
148
|
color: 'neutral',
|
|
151
149
|
onClick: handleOpen,
|
|
@@ -153,28 +151,28 @@ function Select(props, ref) {
|
|
|
153
151
|
mi: 'arrow_drop_down'
|
|
154
152
|
})]
|
|
155
153
|
});
|
|
156
|
-
const cachedWrapperProps =
|
|
154
|
+
const cachedWrapperProps = useMemo(() => ({
|
|
157
155
|
onClick: handleOpen
|
|
158
156
|
}), []);
|
|
159
|
-
const cachedClasses =
|
|
157
|
+
const cachedClasses = useMemo(() => {
|
|
160
158
|
var _inputProps$classes;
|
|
161
159
|
return {
|
|
162
160
|
...inputProps.classes,
|
|
163
|
-
wrapper: (
|
|
161
|
+
wrapper: clsx((_inputProps$classes = inputProps.classes) == null ? void 0 : _inputProps$classes.wrapper, 'arm-select__wrapper')
|
|
164
162
|
};
|
|
165
163
|
}, []);
|
|
166
|
-
const cachedStyles =
|
|
164
|
+
const cachedStyles = useMemo(() => ({
|
|
167
165
|
pointerEvents: 'none'
|
|
168
166
|
}), []);
|
|
169
|
-
return /*#__PURE__*/(
|
|
170
|
-
children: /*#__PURE__*/(
|
|
167
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
168
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
171
169
|
className: className,
|
|
172
|
-
children: [/*#__PURE__*/(
|
|
170
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
173
171
|
className: 'arm-select',
|
|
174
|
-
children: [/*#__PURE__*/(
|
|
172
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
175
173
|
className: 'arm-select__input_wrapper',
|
|
176
174
|
ref: anchorEl,
|
|
177
|
-
children: /*#__PURE__*/(
|
|
175
|
+
children: /*#__PURE__*/_jsx(TextField, {
|
|
178
176
|
...inputProps,
|
|
179
177
|
classes: cachedClasses,
|
|
180
178
|
onChange: handleSearch,
|
|
@@ -188,12 +186,12 @@ function Select(props, ref) {
|
|
|
188
186
|
style: cachedStyles,
|
|
189
187
|
WrapperProps: cachedWrapperProps
|
|
190
188
|
})
|
|
191
|
-
}), multiple && !realActive && /*#__PURE__*/(
|
|
189
|
+
}), multiple && !realActive && /*#__PURE__*/_jsx(SelectSummaryChips, {
|
|
192
190
|
options: selectedOptions,
|
|
193
191
|
disabled: inputProps.disabled,
|
|
194
192
|
onDelete: handleSelect
|
|
195
193
|
})]
|
|
196
|
-
}), realActive && (!inline && anchorEl.current ? /*#__PURE__*/(
|
|
194
|
+
}), realActive && (!inline && anchorEl.current ? /*#__PURE__*/_jsx(Popover, {
|
|
197
195
|
classes: {
|
|
198
196
|
paper: 'px-0'
|
|
199
197
|
},
|
|
@@ -202,7 +200,7 @@ function Select(props, ref) {
|
|
|
202
200
|
open: realActive,
|
|
203
201
|
onClose: handleClose,
|
|
204
202
|
placement: 'bottom-start',
|
|
205
|
-
children: /*#__PURE__*/(
|
|
203
|
+
children: /*#__PURE__*/_jsx(SelectOptions, {
|
|
206
204
|
disabled: inputProps.disabled,
|
|
207
205
|
options: options,
|
|
208
206
|
multiple: multiple,
|
|
@@ -216,9 +214,9 @@ function Select(props, ref) {
|
|
|
216
214
|
onSelectAll: handleSelectAll,
|
|
217
215
|
onSubmit: handleSubmit
|
|
218
216
|
})
|
|
219
|
-
}) : /*#__PURE__*/(
|
|
217
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
220
218
|
ref: inlineOptRef,
|
|
221
|
-
children: /*#__PURE__*/(
|
|
219
|
+
children: /*#__PURE__*/_jsx(SelectOptions, {
|
|
222
220
|
disabled: inputProps.disabled,
|
|
223
221
|
options: options,
|
|
224
222
|
multiple: multiple,
|
|
@@ -236,7 +234,7 @@ function Select(props, ref) {
|
|
|
236
234
|
})
|
|
237
235
|
});
|
|
238
236
|
}
|
|
239
|
-
const SelectOptions =
|
|
237
|
+
export const SelectOptions = /*#__PURE__*/forwardRef((props, ref) => {
|
|
240
238
|
let {
|
|
241
239
|
options,
|
|
242
240
|
value,
|
|
@@ -251,20 +249,20 @@ const SelectOptions = exports.SelectOptions = /*#__PURE__*/(0, _react.forwardRef
|
|
|
251
249
|
...callbacks
|
|
252
250
|
} = props;
|
|
253
251
|
if (multiple && optionControls === undefined) optionControls = true;
|
|
254
|
-
return /*#__PURE__*/(
|
|
255
|
-
children: /*#__PURE__*/(
|
|
252
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
253
|
+
children: /*#__PURE__*/_jsxs(SelectOptionsContainer, {
|
|
256
254
|
ref: ref,
|
|
257
255
|
inline: !!inline,
|
|
258
|
-
children: [beforeList, /*#__PURE__*/(
|
|
256
|
+
children: [beforeList, /*#__PURE__*/_jsx(SelectOptionList, {
|
|
259
257
|
options: options,
|
|
260
258
|
multiple: multiple,
|
|
261
259
|
value: value,
|
|
262
260
|
listStyle: listStyle,
|
|
263
261
|
disabled: disabled,
|
|
264
262
|
onChange: onClick
|
|
265
|
-
}), afterList, !!optionControls && !!multiple && /*#__PURE__*/(
|
|
263
|
+
}), afterList, !!optionControls && !!multiple && /*#__PURE__*/_jsx("div", {
|
|
266
264
|
className: 'arm-selectSummary__wrapper',
|
|
267
|
-
children: /*#__PURE__*/(
|
|
265
|
+
children: /*#__PURE__*/_jsx(SelectSummary, {
|
|
268
266
|
options: options,
|
|
269
267
|
value: value,
|
|
270
268
|
onClose: onClick,
|
|
@@ -289,4 +287,5 @@ const SelectOptions = exports.SelectOptions = /*#__PURE__*/(0, _react.forwardRef
|
|
|
289
287
|
// text: '123123123'
|
|
290
288
|
// },]} />
|
|
291
289
|
// }
|
|
292
|
-
|
|
290
|
+
|
|
291
|
+
export default fixedForwardRef(Select);
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.SelectOptionList = void 0;
|
|
6
|
-
var _List = _interopRequireDefault(require("../../List"));
|
|
7
|
-
var _Select = require("./Select");
|
|
8
|
-
var _helpers = require("../../../lib/helpers");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import ListItem from "../../List";
|
|
2
|
+
import { getOptionValue } from "./Select";
|
|
3
|
+
import { fixedForwardRef } from "../../../lib/helpers";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
5
|
function SelectOptionListBase(props, ref) {
|
|
11
6
|
const {
|
|
12
7
|
options,
|
|
@@ -16,14 +11,14 @@ function SelectOptionListBase(props, ref) {
|
|
|
16
11
|
disabled,
|
|
17
12
|
onChange
|
|
18
13
|
} = props;
|
|
19
|
-
return /*#__PURE__*/(
|
|
14
|
+
return /*#__PURE__*/_jsx("div", {
|
|
20
15
|
ref: ref,
|
|
21
16
|
className: "arm-options__list",
|
|
22
17
|
children: options.map((item, index) => {
|
|
23
|
-
let optValue =
|
|
18
|
+
let optValue = getOptionValue(item);
|
|
24
19
|
let active = multiple === true && value ? value.includes(optValue) : optValue === value;
|
|
25
20
|
let checked = listStyle === 'checkbox' && !!multiple ? active : undefined;
|
|
26
|
-
return /*#__PURE__*/(
|
|
21
|
+
return /*#__PURE__*/_jsx(ListItem, {
|
|
27
22
|
disabled: disabled || !!item.disabled,
|
|
28
23
|
checked: checked,
|
|
29
24
|
active: active,
|
|
@@ -33,4 +28,4 @@ function SelectOptionListBase(props, ref) {
|
|
|
33
28
|
})
|
|
34
29
|
});
|
|
35
30
|
}
|
|
36
|
-
const SelectOptionList =
|
|
31
|
+
export const SelectOptionList = fixedForwardRef(SelectOptionListBase);
|
|
@@ -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
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from './Select';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export { type SelectChangeEvent, type SelectProps, type SelectOptionsType, SelectOptions } from './Select';
|
|
3
|
+
export { SelectSummary, SelectSummaryChips, type SelectSummaryProps } from './SelectSummary';
|
package/ui/Form/Select/index.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _exportNames = {};
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _Select = _interopRequireWildcard(require("./Select"));
|
|
7
|
-
exports.default = _Select.default;
|
|
8
|
-
Object.keys(_Select).forEach(function (key) {
|
|
9
|
-
if (key === "default" || key === "__esModule") return;
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
11
|
-
if (key in exports && exports[key] === _Select[key]) return;
|
|
12
|
-
exports[key] = _Select[key];
|
|
13
|
-
});
|
|
14
|
-
var _SelectSummary = require("./SelectSummary");
|
|
15
|
-
Object.keys(_SelectSummary).forEach(function (key) {
|
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
-
if (key in exports && exports[key] === _SelectSummary[key]) return;
|
|
19
|
-
exports[key] = _SelectSummary[key];
|
|
20
|
-
});
|
|
21
|
-
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); }
|
|
22
|
-
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; }
|
|
23
|
-
module.exports = exports.default;
|
|
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,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
var _exportNames = {};
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _Switch = _interopRequireWildcard(require("./Switch"));
|
|
7
|
-
exports.default = _Switch.default;
|
|
8
|
-
Object.keys(_Switch).forEach(function (key) {
|
|
9
|
-
if (key === "default" || key === "__esModule") return;
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
11
|
-
if (key in exports && exports[key] === _Switch[key]) return;
|
|
12
|
-
exports[key] = _Switch[key];
|
|
13
|
-
});
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
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,2 +1,2 @@
|
|
|
1
1
|
export { default } from './TextArea';
|
|
2
|
-
export
|
|
2
|
+
export { type TextAreaProps } from './TextArea';
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
var _exportNames = {};
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _TextArea = _interopRequireWildcard(require("./TextArea"));
|
|
7
|
-
exports.default = _TextArea.default;
|
|
8
|
-
Object.keys(_TextArea).forEach(function (key) {
|
|
9
|
-
if (key === "default" || key === "__esModule") return;
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
11
|
-
if (key in exports && exports[key] === _TextArea[key]) return;
|
|
12
|
-
exports[key] = _TextArea[key];
|
|
13
|
-
});
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
module.exports = exports.default;
|
|
1
|
+
export { default } from "./TextArea";
|