@salutejs/plasma-new-hope 0.322.0-canary.1939.14616445713.0 → 0.322.0-canary.1939.14664752830.0
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/cjs/components/Calendar/utils/calendarRangeHelper.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +17 -19
- package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -7
- package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
- package/cjs/components/DatePicker/hooks/useDatePicker.js +73 -46
- package/cjs/components/DatePicker/hooks/useDatePicker.js.map +1 -1
- package/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +3 -1
- package/cjs/components/DatePicker/hooks/useKeyboardNavigation.js.map +1 -1
- package/cjs/components/DatePicker/utils/dateHelper.js +4 -0
- package/cjs/components/DatePicker/utils/dateHelper.js.map +1 -1
- package/cjs/components/DatePicker/utils/getFormattedDates.js +2 -1
- package/cjs/components/DatePicker/utils/getFormattedDates.js.map +1 -1
- package/cjs/components/DatePicker/utils/getMaskedDateOnInput.js +3 -1
- package/cjs/components/DatePicker/utils/getMaskedDateOnInput.js.map +1 -1
- package/cjs/components/DatePicker/utils/getOriginalDates.js +5 -13
- package/cjs/components/DatePicker/utils/getOriginalDates.js.map +1 -1
- package/cjs/components/DatePicker/utils/normalizeDates.js +6 -3
- package/cjs/components/DatePicker/utils/normalizeDates.js.map +1 -1
- package/emotion/cjs/components/Accordion/Accordion.template-doc.mdx +99 -71
- package/emotion/cjs/components/Autocomplete/Autocomplete.template-doc.mdx +523 -454
- package/emotion/cjs/components/Checkbox/Checkbox.template-doc.mdx +3 -3
- package/emotion/cjs/components/Combobox/Combobox.template-doc.mdx +58 -27
- package/emotion/cjs/components/DatePicker/DatePicker.template-doc.mdx +5 -0
- package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +17 -19
- package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -7
- package/emotion/cjs/components/DatePicker/hooks/useDatePicker.js +73 -46
- package/emotion/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +2 -1
- package/emotion/cjs/components/DatePicker/utils/dateHelper.js +4 -1
- package/emotion/cjs/components/DatePicker/utils/getFormattedDates.js +2 -1
- package/emotion/cjs/components/DatePicker/utils/getMaskedDateOnInput.js +2 -1
- package/emotion/cjs/components/DatePicker/utils/getOriginalDates.js +10 -13
- package/emotion/cjs/components/DatePicker/utils/normalizeDates.js +6 -3
- package/emotion/cjs/components/Dropdown/Dropdown.template-doc.mdx +10 -10
- package/emotion/cjs/components/Flow/Flow.template-doc.mdx +2 -2
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +10 -1
- package/emotion/cjs/components/NumberFormat/NumberFormat.template-doc.mdx +4 -4
- package/emotion/cjs/components/Radiobox/Radiobox.template-doc.mdx +10 -11
- package/emotion/cjs/components/Range/Range.template-doc.mdx +5 -1
- package/emotion/cjs/components/Segment/Segment.template-doc.mdx +3 -3
- package/emotion/cjs/components/Select/Select.template-doc.mdx +27 -27
- package/emotion/cjs/components/Slider/Slider.template-doc.mdx +2 -2
- package/emotion/cjs/components/Switch/Switch.template-doc.mdx +3 -3
- package/emotion/cjs/components/Table/Table.template-doc.mdx +2 -2
- package/emotion/cjs/components/Tabs/Tabs.template-doc.mdx +11 -7
- package/emotion/cjs/components/TextArea/TextArea.template-doc.mdx +9 -2
- package/emotion/cjs/components/TextField/TextField.template-doc.mdx +117 -32
- package/emotion/cjs/components/Toast/Toast.template-doc.mdx +48 -2
- package/emotion/cjs/components/Tooltip/Tooltip.template-doc.mdx +19 -4
- package/emotion/cjs/components/Tree/Tree.template-doc.mdx +0 -1
- package/emotion/es/components/Accordion/Accordion.template-doc.mdx +99 -71
- package/emotion/es/components/Autocomplete/Autocomplete.template-doc.mdx +523 -454
- package/emotion/es/components/Checkbox/Checkbox.template-doc.mdx +3 -3
- package/emotion/es/components/Combobox/Combobox.template-doc.mdx +58 -27
- package/emotion/es/components/DatePicker/DatePicker.template-doc.mdx +5 -0
- package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +17 -19
- package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +6 -8
- package/emotion/es/components/DatePicker/hooks/useDatePicker.js +73 -46
- package/emotion/es/components/DatePicker/hooks/useKeyboardNavigation.js +2 -1
- package/emotion/es/components/DatePicker/utils/dateHelper.js +3 -0
- package/emotion/es/components/DatePicker/utils/getFormattedDates.js +2 -1
- package/emotion/es/components/DatePicker/utils/getMaskedDateOnInput.js +2 -1
- package/emotion/es/components/DatePicker/utils/getOriginalDates.js +10 -13
- package/emotion/es/components/DatePicker/utils/normalizeDates.js +6 -3
- package/emotion/es/components/Dropdown/Dropdown.template-doc.mdx +10 -10
- package/emotion/es/components/Flow/Flow.template-doc.mdx +2 -2
- package/emotion/es/components/Notification/Notification.template-doc.mdx +10 -1
- package/emotion/es/components/NumberFormat/NumberFormat.template-doc.mdx +4 -4
- package/emotion/es/components/Radiobox/Radiobox.template-doc.mdx +10 -11
- package/emotion/es/components/Range/Range.template-doc.mdx +5 -1
- package/emotion/es/components/Segment/Segment.template-doc.mdx +3 -3
- package/emotion/es/components/Select/Select.template-doc.mdx +27 -27
- package/emotion/es/components/Slider/Slider.template-doc.mdx +2 -2
- package/emotion/es/components/Switch/Switch.template-doc.mdx +3 -3
- package/emotion/es/components/Table/Table.template-doc.mdx +2 -2
- package/emotion/es/components/Tabs/Tabs.template-doc.mdx +11 -7
- package/emotion/es/components/TextArea/TextArea.template-doc.mdx +9 -2
- package/emotion/es/components/TextField/TextField.template-doc.mdx +117 -32
- package/emotion/es/components/Toast/Toast.template-doc.mdx +48 -2
- package/emotion/es/components/Tooltip/Tooltip.template-doc.mdx +19 -4
- package/emotion/es/components/Tree/Tree.template-doc.mdx +0 -1
- package/es/components/Calendar/utils/calendarRangeHelper.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.js +19 -21
- package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
- package/es/components/DatePicker/SingleDate/SingleDate.js +7 -9
- package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
- package/es/components/DatePicker/hooks/useDatePicker.js +73 -46
- package/es/components/DatePicker/hooks/useDatePicker.js.map +1 -1
- package/es/components/DatePicker/hooks/useKeyboardNavigation.js +3 -1
- package/es/components/DatePicker/hooks/useKeyboardNavigation.js.map +1 -1
- package/es/components/DatePicker/utils/dateHelper.js +4 -1
- package/es/components/DatePicker/utils/dateHelper.js.map +1 -1
- package/es/components/DatePicker/utils/getFormattedDates.js +2 -1
- package/es/components/DatePicker/utils/getFormattedDates.js.map +1 -1
- package/es/components/DatePicker/utils/getMaskedDateOnInput.js +3 -1
- package/es/components/DatePicker/utils/getMaskedDateOnInput.js.map +1 -1
- package/es/components/DatePicker/utils/getOriginalDates.js +5 -13
- package/es/components/DatePicker/utils/getOriginalDates.js.map +1 -1
- package/es/components/DatePicker/utils/normalizeDates.js +6 -3
- package/es/components/DatePicker/utils/normalizeDates.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Accordion/Accordion.template-doc.mdx +99 -71
- package/styled-components/cjs/components/Autocomplete/Autocomplete.template-doc.mdx +523 -454
- package/styled-components/cjs/components/Checkbox/Checkbox.template-doc.mdx +3 -3
- package/styled-components/cjs/components/Combobox/Combobox.template-doc.mdx +58 -27
- package/styled-components/cjs/components/DatePicker/DatePicker.template-doc.mdx +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +17 -19
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -7
- package/styled-components/cjs/components/DatePicker/hooks/useDatePicker.js +73 -46
- package/styled-components/cjs/components/DatePicker/hooks/useKeyboardNavigation.js +2 -1
- package/styled-components/cjs/components/DatePicker/utils/dateHelper.js +4 -1
- package/styled-components/cjs/components/DatePicker/utils/getFormattedDates.js +2 -1
- package/styled-components/cjs/components/DatePicker/utils/getMaskedDateOnInput.js +2 -1
- package/styled-components/cjs/components/DatePicker/utils/getOriginalDates.js +10 -13
- package/styled-components/cjs/components/DatePicker/utils/normalizeDates.js +6 -3
- package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +10 -10
- package/styled-components/cjs/components/Flow/Flow.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +10 -1
- package/styled-components/cjs/components/NumberFormat/NumberFormat.template-doc.mdx +4 -4
- package/styled-components/cjs/components/Radiobox/Radiobox.template-doc.mdx +10 -11
- package/styled-components/cjs/components/Range/Range.template-doc.mdx +5 -1
- package/styled-components/cjs/components/Segment/Segment.template-doc.mdx +3 -3
- package/styled-components/cjs/components/Select/Select.template-doc.mdx +27 -27
- package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Switch/Switch.template-doc.mdx +3 -3
- package/styled-components/cjs/components/Table/Table.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Tabs/Tabs.template-doc.mdx +11 -7
- package/styled-components/cjs/components/TextArea/TextArea.template-doc.mdx +9 -2
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +117 -32
- package/styled-components/cjs/components/Toast/Toast.template-doc.mdx +48 -2
- package/styled-components/cjs/components/Tooltip/Tooltip.template-doc.mdx +19 -4
- package/styled-components/cjs/components/Tree/Tree.template-doc.mdx +0 -1
- package/styled-components/es/components/Accordion/Accordion.template-doc.mdx +99 -71
- package/styled-components/es/components/Autocomplete/Autocomplete.template-doc.mdx +523 -454
- package/styled-components/es/components/Checkbox/Checkbox.template-doc.mdx +3 -3
- package/styled-components/es/components/Combobox/Combobox.template-doc.mdx +58 -27
- package/styled-components/es/components/DatePicker/DatePicker.template-doc.mdx +5 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +17 -19
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +6 -8
- package/styled-components/es/components/DatePicker/hooks/useDatePicker.js +73 -46
- package/styled-components/es/components/DatePicker/hooks/useKeyboardNavigation.js +2 -1
- package/styled-components/es/components/DatePicker/utils/dateHelper.js +3 -0
- package/styled-components/es/components/DatePicker/utils/getFormattedDates.js +2 -1
- package/styled-components/es/components/DatePicker/utils/getMaskedDateOnInput.js +2 -1
- package/styled-components/es/components/DatePicker/utils/getOriginalDates.js +10 -13
- package/styled-components/es/components/DatePicker/utils/normalizeDates.js +6 -3
- package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +10 -10
- package/styled-components/es/components/Flow/Flow.template-doc.mdx +2 -2
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +10 -1
- package/styled-components/es/components/NumberFormat/NumberFormat.template-doc.mdx +4 -4
- package/styled-components/es/components/Radiobox/Radiobox.template-doc.mdx +10 -11
- package/styled-components/es/components/Range/Range.template-doc.mdx +5 -1
- package/styled-components/es/components/Segment/Segment.template-doc.mdx +3 -3
- package/styled-components/es/components/Select/Select.template-doc.mdx +27 -27
- package/styled-components/es/components/Slider/Slider.template-doc.mdx +2 -2
- package/styled-components/es/components/Switch/Switch.template-doc.mdx +3 -3
- package/styled-components/es/components/Table/Table.template-doc.mdx +2 -2
- package/styled-components/es/components/Tabs/Tabs.template-doc.mdx +11 -7
- package/styled-components/es/components/TextArea/TextArea.template-doc.mdx +9 -2
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +117 -32
- package/styled-components/es/components/Toast/Toast.template-doc.mdx +48 -2
- package/styled-components/es/components/Tooltip/Tooltip.template-doc.mdx +19 -4
- package/styled-components/es/components/Tree/Tree.template-doc.mdx +0 -1
- package/types/components/Calendar/utils/calendarRangeHelper.d.ts +1 -1
- package/types/components/Calendar/utils/calendarRangeHelper.d.ts.map +1 -1
- package/types/components/DatePicker/DatePickerBase.types.d.ts +3 -3
- package/types/components/DatePicker/DatePickerBase.types.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts +2 -2
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts +5 -4
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +3 -3
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -1
- package/types/components/DatePicker/hooks/useDatePicker.d.ts +1 -1
- package/types/components/DatePicker/hooks/useDatePicker.d.ts.map +1 -1
- package/types/components/DatePicker/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/types/components/DatePicker/utils/dateHelper.d.ts +1 -0
- package/types/components/DatePicker/utils/dateHelper.d.ts.map +1 -1
- package/types/components/DatePicker/utils/getFormattedDates.d.ts.map +1 -1
- package/types/components/DatePicker/utils/getMaskedDateOnInput.d.ts.map +1 -1
- package/types/components/DatePicker/utils/getOriginalDates.d.ts.map +1 -1
- package/types/components/DatePicker/utils/normalizeDates.d.ts.map +1 -1
- /package/emotion/cjs/components/Combobox/ComboboxOld/{Combobox.template-doc.mdx → Combobox.doc.mdx} +0 -0
- /package/emotion/es/components/Combobox/ComboboxOld/{Combobox.template-doc.mdx → Combobox.doc.mdx} +0 -0
- /package/styled-components/cjs/components/Combobox/ComboboxOld/{Combobox.template-doc.mdx → Combobox.doc.mdx} +0 -0
- /package/styled-components/es/components/Combobox/ComboboxOld/{Combobox.template-doc.mdx → Combobox.doc.mdx} +0 -0
@@ -1,3 +1,9 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
1
7
|
import { customDayjs } from "../../../utils/datejs";
|
2
8
|
var initialValueStructure = {
|
3
9
|
isoDate: '',
|
@@ -5,7 +11,7 @@ var initialValueStructure = {
|
|
5
11
|
formattedDate: ''
|
6
12
|
};
|
7
13
|
export var getOriginalDates = function getOriginalDates(value, lang, format) {
|
8
|
-
if (!value || !lang) {
|
14
|
+
if (!value || !lang || !format) {
|
9
15
|
return initialValueStructure;
|
10
16
|
}
|
11
17
|
customDayjs.locale(lang);
|
@@ -16,13 +22,6 @@ export var getOriginalDates = function getOriginalDates(value, lang, format) {
|
|
16
22
|
originalDate: new Date(value)
|
17
23
|
};
|
18
24
|
}
|
19
|
-
if (!format) {
|
20
|
-
return {
|
21
|
-
formattedDate: value,
|
22
|
-
isoDate: '',
|
23
|
-
originalDate: undefined
|
24
|
-
};
|
25
|
-
}
|
26
25
|
if (customDayjs(value, format).isValid()) {
|
27
26
|
var isoDate = customDayjs(value, format).toISOString();
|
28
27
|
var originalDate = customDayjs(value, format).toDate();
|
@@ -33,9 +32,7 @@ export var getOriginalDates = function getOriginalDates(value, lang, format) {
|
|
33
32
|
originalDate: originalDate
|
34
33
|
};
|
35
34
|
}
|
36
|
-
return {
|
37
|
-
formattedDate: value
|
38
|
-
|
39
|
-
originalDate: undefined
|
40
|
-
};
|
35
|
+
return _objectSpread(_objectSpread({}, initialValueStructure), {}, {
|
36
|
+
formattedDate: value
|
37
|
+
});
|
41
38
|
};
|
@@ -10,11 +10,14 @@ export var normalizeDates = function normalizeDates(_ref) {
|
|
10
10
|
customDayjs.locale(lang);
|
11
11
|
if (min && includeEdgeDates && min > originalDate) {
|
12
12
|
dateCandidate = min;
|
13
|
-
}
|
13
|
+
}
|
14
|
+
if (min && !includeEdgeDates && min >= originalDate) {
|
14
15
|
dateCandidate = customDayjs(min).add(1, 'd').toDate();
|
15
|
-
}
|
16
|
+
}
|
17
|
+
if (max && includeEdgeDates && max < originalDate) {
|
16
18
|
dateCandidate = max;
|
17
|
-
}
|
19
|
+
}
|
20
|
+
if (max && !includeEdgeDates && max <= originalDate) {
|
18
21
|
dateCandidate = customDayjs(max).subtract(1, 'd').toDate();
|
19
22
|
}
|
20
23
|
var formattedDateCandidate = format ? customDayjs(dateCandidate).format(format) : dateCandidate.toString();
|
@@ -30,7 +30,7 @@ type Items = Array<{
|
|
30
30
|
*/
|
31
31
|
label: string;
|
32
32
|
/**
|
33
|
-
* Сторона открытия вложенного
|
33
|
+
* Сторона открытия вложенного Dropdown относительно текущего элемента;
|
34
34
|
*/
|
35
35
|
placement?: DropdownPlacement;
|
36
36
|
/**
|
@@ -117,7 +117,7 @@ type Items = Array<{
|
|
117
117
|
|
118
118
|
|
119
119
|
return (
|
120
|
-
<div style
|
120
|
+
<div style=\{{ height:"300px" }}>
|
121
121
|
<Dropdown
|
122
122
|
items={items}
|
123
123
|
>
|
@@ -170,7 +170,7 @@ type Items = Array<{
|
|
170
170
|
];
|
171
171
|
|
172
172
|
return (
|
173
|
-
<div style
|
173
|
+
<div style=\{{ height: "300px", display: "flex", gap: "50px" }}>
|
174
174
|
<Dropdown
|
175
175
|
items={items}
|
176
176
|
size="l"
|
@@ -245,7 +245,7 @@ type Items = Array<{
|
|
245
245
|
];
|
246
246
|
|
247
247
|
return (
|
248
|
-
<div style
|
248
|
+
<div style=\{{ height: "300px", display: "flex", gap: "50px" }}>
|
249
249
|
<Dropdown
|
250
250
|
items={items}
|
251
251
|
>
|
@@ -327,7 +327,7 @@ type Items = Array<{
|
|
327
327
|
];
|
328
328
|
|
329
329
|
return (
|
330
|
-
<div style
|
330
|
+
<div style=\{{ height:"300px" }}>
|
331
331
|
<Dropdown
|
332
332
|
items={items}
|
333
333
|
trigger="hover"
|
@@ -380,10 +380,10 @@ type Items = Array<{
|
|
380
380
|
},
|
381
381
|
];
|
382
382
|
|
383
|
-
const ref = useRef(null)
|
383
|
+
const ref = useRef(null);
|
384
384
|
|
385
385
|
return (
|
386
|
-
<div style
|
386
|
+
<div style=\{{ position: "relative", height: "300px" }} ref={ref}>
|
387
387
|
<Dropdown items={items} portal={ref}>
|
388
388
|
<Button text="Список стран" />
|
389
389
|
</Dropdown>
|
@@ -399,13 +399,13 @@ type Items = Array<{
|
|
399
399
|
Данный компонент соответствует требования W3C: [Combobox](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) и частично [TreeView](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/).
|
400
400
|
|
401
401
|
- `Tab` - закрывает Dropdown. Перемещает фокус на следующий элемент на странице;
|
402
|
-
- `Enter` - открывает/закрывает Dropdown. Если на элементе
|
403
|
-
- `Space` - открывает/закрывает Dropdown. Если на элементе
|
402
|
+
- `Enter` - открывает/закрывает Dropdown. Если на элементе — выбирает его;
|
403
|
+
- `Space` - открывает/закрывает Dropdown. Если на элементе — выбирает его;
|
404
404
|
- `Home` - открывает Dropdown и перемещает фокус на первый элемент;
|
405
405
|
- `End` - открывает Dropdown и перемещает фокус на последний элемент;
|
406
406
|
- `PageUp` - перемещает фокус на 10 элементов выше либо в начало списка;
|
407
407
|
- `PageDown` - перемещает фокус на 10 элементов ниже либо в конце списка;
|
408
408
|
- `ArrowUp` - открывает Dropdown и перемещает фокус на первый элемент. Перемещает фокус на один элемент выше;
|
409
409
|
- `ArrowDown` - открывает Dropdown и перемещает фокус на первый элемент. Перемещает фокус на один элемент ниже;
|
410
|
-
- `ArrowRight` - если фокус на элементе вложенного списка
|
410
|
+
- `ArrowRight` - если фокус на элементе вложенного списка — открывает его и перемещает фокус на первый элемент;
|
411
411
|
- `ArrowLeft` - закрывает текущий список и перемещает фокус на предыдущий;
|
@@ -41,7 +41,7 @@ export function App() {
|
|
41
41
|
|
42
42
|
return (
|
43
43
|
<div>
|
44
|
-
<Flow mainAxisGap="0.5ch" crossAxisGap="1ch" style
|
44
|
+
<Flow mainAxisGap="0.5ch" crossAxisGap="1ch" style=\{{ width: '15ch' }} >
|
45
45
|
{Array(6)
|
46
46
|
.fill(0)
|
47
47
|
.map((_, i) => (<div key={i} style={style(i)}>{numbers[i]}</div>))}
|
@@ -77,7 +77,7 @@ export function App() {
|
|
77
77
|
orientation="vertical"
|
78
78
|
mainAxisGap="0.5ch"
|
79
79
|
crossAxisGap="1ch"
|
80
|
-
style
|
80
|
+
style=\{{ height: '90px' }}
|
81
81
|
>
|
82
82
|
{Array(6)
|
83
83
|
.fill(0)
|
@@ -20,7 +20,7 @@ import { PropsTable, Description } from '@site/src/components';
|
|
20
20
|
<PropsTable name="NotificationsProvider" />
|
21
21
|
|
22
22
|
Поместите `NotificationsProvider` в [корень приложения](../../#корень-приложения) или там, где будете применять модальные окна.
|
23
|
-
В качестве свойств можно указать контейнер для оповещений через `frame
|
23
|
+
В качестве свойств можно указать контейнер для оповещений через `frame`.
|
24
24
|
|
25
25
|
```tsx title="index.ts"
|
26
26
|
import ReactDOM from 'react-dom';
|
@@ -36,6 +36,15 @@ ReactDOM.render(
|
|
36
36
|
);
|
37
37
|
```
|
38
38
|
|
39
|
+
### Позиционирование
|
40
|
+
|
41
|
+
Позиционирование компонента регулируется с помощью свойства `placement`.
|
42
|
+
|
43
|
+
```ts
|
44
|
+
type NotificationPlacement = 'center' | 'top' | 'bottom' | 'right' | 'left';
|
45
|
+
````
|
46
|
+
И производные комбинации, например `bottom-left` или `top-right`.
|
47
|
+
|
39
48
|
### Вызов уведомления
|
40
49
|
После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`, который приведет к отображению оповещения.
|
41
50
|
Функция принимает значения свойств компонента `Notification`, включая необязательное поле `id`. И возвращает сгенерированный или переданный `id`, по которому можно закрыть оповещение через вызов `closeNotification`.
|
@@ -10,8 +10,8 @@ import { PropsTable, Description } from '@site/src/components';
|
|
10
10
|
<PropsTable name="NumberFormat" exclude={['css']} />
|
11
11
|
|
12
12
|
## Использование
|
13
|
-
Компонент `NumberFormat` представляет собой поле ввода
|
14
|
-
Он реализован на компоненте [TextField](https://plasma.sberdevices.ru/
|
13
|
+
Компонент `NumberFormat` представляет собой поле ввода числовых значений.
|
14
|
+
Он реализован на компоненте [TextField](https://plasma.sberdevices.ru/{{ name }}/components/textfield/)
|
15
15
|
и наследует практически все его свойства (`size`, `view`, `disabled`, `label` и тд.)
|
16
16
|
|
17
17
|
### Разделитель тысяч и десятичных знаков
|
@@ -146,7 +146,7 @@ export function App() {
|
|
146
146
|
```
|
147
147
|
|
148
148
|
### Ведущие нули
|
149
|
-
Чтобы разрешить в числе ведущие нули,
|
149
|
+
Чтобы разрешить в числе ведущие нули, нужно указать свойство `allowLeadingZeros`:
|
150
150
|
|
151
151
|
```tsx live
|
152
152
|
import React from 'react';
|
@@ -165,4 +165,4 @@ export function App() {
|
|
165
165
|
</div>
|
166
166
|
);
|
167
167
|
}
|
168
|
-
```
|
168
|
+
```
|
@@ -7,18 +7,18 @@ import { PropsTable, Description } from '@site/src/components';
|
|
7
7
|
|
8
8
|
# Radiobox
|
9
9
|
<Description name="Radiobox" />
|
10
|
-
<PropsTable name="Radiobox" exclude={['css', 'focused']} />
|
10
|
+
<PropsTable name="Radiobox" exclude={['css', 'focused']} include={['defaultChecked']} />
|
11
11
|
|
12
12
|
:::caution Устаревшие значения для свойства view
|
13
|
-
Актуальным значением для свойства `view` - является `accent`.
|
13
|
+
Актуальным значением для свойства `view` - является `accent`.
|
14
14
|
|
15
|
-
Все остальные значения `deprecated` и будут удалены в ближайшее время!
|
15
|
+
Все остальные значения `deprecated` и будут удалены в ближайшее время!
|
16
16
|
:::
|
17
17
|
|
18
18
|
## Использование
|
19
19
|
Компонент `Radiobox` может содержать лейбл и описание.
|
20
20
|
|
21
|
-
По умолчанию, контент внутри лейбла и описания многострочный.
|
21
|
+
По умолчанию, контент внутри лейбла и описания многострочный.
|
22
22
|
|
23
23
|
Для того чтобы стал однострочным, необходимо использовать свойство `singleLine`(по умолчанию `false`).
|
24
24
|
|
@@ -34,14 +34,13 @@ export function App() {
|
|
34
34
|
```
|
35
35
|
|
36
36
|
## RadioGroup
|
37
|
+
|
37
38
|
Компоненты `Radiobox` следует объединять в `RadioGroup`
|
38
39
|
|
39
40
|
```tsx live
|
40
|
-
<
|
41
|
-
<
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
</RadioGroup>
|
46
|
-
</div>
|
41
|
+
<RadioGroup aria-labelledby="radiogroup-title-id">
|
42
|
+
<H3 id="radiogroup-title-id">Заголовок</H3>
|
43
|
+
<Radiobox name="radio-1" label="Радиокнопка 1" description="Описание 1" defaultChecked />
|
44
|
+
<Radiobox name="radio-1" label="Радиокнопка 2" description="Описание 2" />
|
45
|
+
</RadioGroup>
|
47
46
|
```
|
@@ -323,6 +323,10 @@ export function App() {
|
|
323
323
|
```
|
324
324
|
|
325
325
|
### Обязательность поля
|
326
|
+
:::tip
|
327
|
+
Наличие индикатора регулируется свойством `hasRequiredIndicator`.
|
328
|
+
:::
|
329
|
+
|
326
330
|
Обязательность поля задаётся с помощью свойства `required`.
|
327
331
|
Если поле является обязательным, то у компонента появляется специальный индикатор.
|
328
332
|
Изменить расположение индикатора можно с помощью свойства `requiredPlacement`, которое принимает значения `left` и `right`.
|
@@ -356,4 +360,4 @@ export function App() {
|
|
356
360
|
</div>
|
357
361
|
);
|
358
362
|
}
|
359
|
-
```
|
363
|
+
```
|
@@ -59,7 +59,7 @@ export function App() {
|
|
59
59
|
}
|
60
60
|
|
61
61
|
return (
|
62
|
-
<div style
|
62
|
+
<div style=\{{ display: "block" }} >
|
63
63
|
<SegmentProvider defaultSelected={['label_1']}>
|
64
64
|
<SegmentTemplate/>
|
65
65
|
</SegmentProvider>
|
@@ -103,7 +103,7 @@ export function App() {
|
|
103
103
|
}
|
104
104
|
|
105
105
|
return (
|
106
|
-
<div style
|
106
|
+
<div style=\{{ display: "block" }} >
|
107
107
|
<SegmentProvider defaultSelected={['label_1']} singleSelectedRequired>
|
108
108
|
<SegmentTemplate/>
|
109
109
|
</SegmentProvider>
|
@@ -145,7 +145,7 @@ export function App() {
|
|
145
145
|
}
|
146
146
|
|
147
147
|
return (
|
148
|
-
<div style
|
148
|
+
<div style=\{{ display: "block" }} >
|
149
149
|
<SegmentProvider defaultSelected={['label_1']}>
|
150
150
|
<SegmentTemplate/>
|
151
151
|
</SegmentProvider>
|
@@ -104,12 +104,12 @@ Select может выглядеть как Button и как Textfield. За э
|
|
104
104
|
];
|
105
105
|
|
106
106
|
return (
|
107
|
-
<div style
|
108
|
-
<div style
|
107
|
+
<div style=\{{ display: 'flex', gap: '30px', height: '300px' }}>
|
108
|
+
<div style=\{{width: '300px'}}>
|
109
109
|
<Select items={items} value={singleValue} onChange={setSingleValue} label="Label" placeholder="Placeholder" helperText="Helper text" />
|
110
110
|
</div>
|
111
111
|
|
112
|
-
<div style
|
112
|
+
<div style=\{{width: '300px'}}>
|
113
113
|
<Select multiselect items={items} value={multipleValue} onChange={setMultipleValue} label="Label" placeholder="Placeholder" helperText="Helper text" />
|
114
114
|
</div>
|
115
115
|
</div>
|
@@ -150,12 +150,12 @@ Select может выглядеть как Button и как Textfield. За э
|
|
150
150
|
];
|
151
151
|
|
152
152
|
return (
|
153
|
-
<div style
|
154
|
-
<div style
|
153
|
+
<div style=\{{display: 'flex', gap: '30px', height: '300px' }}>
|
154
|
+
<div style=\{{width: '300px'}}>
|
155
155
|
<Select items={items} label="Single" target="button-like" value={singleValue} onChange={setSingleValue} />
|
156
156
|
</div>
|
157
157
|
|
158
|
-
<div style
|
158
|
+
<div style=\{{width: '300px'}}>
|
159
159
|
<Select multiselect items={items} label="Multiple" target="button-like" value={multipleValue} onChange={setMultipleValue} />
|
160
160
|
</div>
|
161
161
|
</div>
|
@@ -195,8 +195,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
195
195
|
];
|
196
196
|
|
197
197
|
return (
|
198
|
-
<div style
|
199
|
-
<div style
|
198
|
+
<div style=\{{display: 'flex', gap: '30px', height: '300px' }}>
|
199
|
+
<div style=\{{width: '300px'}}>
|
200
200
|
<Select multiselect items={items} label="Label" placeholder="Placeholder" value={multipleValue} onChange={setMultipleValue} />
|
201
201
|
</div>
|
202
202
|
|
@@ -246,8 +246,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
246
246
|
};
|
247
247
|
|
248
248
|
return (
|
249
|
-
<div style
|
250
|
-
<div style
|
249
|
+
<div style=\{{ height: '300px' }}>
|
250
|
+
<div style=\{{ width: '300px' }}>
|
251
251
|
<Select
|
252
252
|
items={items}
|
253
253
|
label="Label"
|
@@ -290,7 +290,7 @@ Select может выглядеть как Button и как Textfield. За э
|
|
290
290
|
if (Array.isArray(itemData)) {
|
291
291
|
if (itemData.length === 0) {
|
292
292
|
return (
|
293
|
-
<div style
|
293
|
+
<div style=\{{ padding: '0.5rem 0' }}>
|
294
294
|
<Cell
|
295
295
|
view="default"
|
296
296
|
title="Выберите страну"
|
@@ -304,7 +304,7 @@ Select может выглядеть как Button и как Textfield. За э
|
|
304
304
|
const title = itemData.map((item) => item.label).join(', ');
|
305
305
|
|
306
306
|
return (
|
307
|
-
<div style
|
307
|
+
<div style=\{{ padding: '0.5rem 0.75rem' }}>
|
308
308
|
<Cell view="default" title={title} subtitle="Subtitle" label="Label" />
|
309
309
|
</div>
|
310
310
|
);
|
@@ -321,8 +321,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
321
321
|
)
|
322
322
|
|
323
323
|
return (
|
324
|
-
<div style
|
325
|
-
<div style
|
324
|
+
<div style=\{{ height: '300px' }}>
|
325
|
+
<div style=\{{ width: '400px' }}>
|
326
326
|
<Select
|
327
327
|
items={items}
|
328
328
|
value={multipleValue}
|
@@ -373,8 +373,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
373
373
|
const ref = useRef(null)
|
374
374
|
|
375
375
|
return (
|
376
|
-
<div style
|
377
|
-
<div style
|
376
|
+
<div style=\{{ position: "relative", height: "300px" }} ref={ref}>
|
377
|
+
<div style=\{{width: '300px'}}>
|
378
378
|
<Select items={items} label="Label" placeholder="Placeholder" value={value} onChange={setValue} portal={ref} listWidth="300px" />
|
379
379
|
</div>
|
380
380
|
</div>
|
@@ -412,8 +412,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
412
412
|
];
|
413
413
|
|
414
414
|
return (
|
415
|
-
<div style
|
416
|
-
<div style
|
415
|
+
<div style=\{{ height: '300px' }}>
|
416
|
+
<div style=\{{width: '300px'}}>
|
417
417
|
<Select items={items} label="Label" placeholder="Placeholder" />
|
418
418
|
</div>
|
419
419
|
</div>
|
@@ -433,7 +433,7 @@ Select может выглядеть как Button и как Textfield. За э
|
|
433
433
|
const items = Array(5000).fill(1).map((_, i) => ({ value: i.toString(), label: i.toString() }));
|
434
434
|
|
435
435
|
return (
|
436
|
-
<div style
|
436
|
+
<div style=\{{ width: "300px", height: "300px" }}>
|
437
437
|
<Select
|
438
438
|
items={items}
|
439
439
|
virtual
|
@@ -490,8 +490,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
490
490
|
};
|
491
491
|
|
492
492
|
return (
|
493
|
-
<div style
|
494
|
-
<div style
|
493
|
+
<div style=\{{ height: "300px" }}>
|
494
|
+
<div style=\{{ width: "300px" }}>
|
495
495
|
<Select
|
496
496
|
items={items}
|
497
497
|
listMaxHeight="200px"
|
@@ -565,8 +565,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
565
565
|
];
|
566
566
|
|
567
567
|
return (
|
568
|
-
<div style
|
569
|
-
<form onSubmit={handleSubmit(onSubmit)} style
|
568
|
+
<div style=\{{ display: "flex", gap: "30px", height: "300px" }}>
|
569
|
+
<form onSubmit={handleSubmit(onSubmit)} style=\{{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
|
570
570
|
<Select
|
571
571
|
items={items}
|
572
572
|
{...register('Select')}
|
@@ -628,8 +628,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
628
628
|
];
|
629
629
|
|
630
630
|
return (
|
631
|
-
<div style
|
632
|
-
<form onSubmit={handleSubmit(onSubmit)} style
|
631
|
+
<div style=\{{ display: "flex", gap: "30px", height: "300px" }}>
|
632
|
+
<form onSubmit={handleSubmit(onSubmit)} style=\{{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
|
633
633
|
<Controller
|
634
634
|
control={control}
|
635
635
|
name="Select"
|
@@ -701,8 +701,8 @@ Select может выглядеть как Button и как Textfield. За э
|
|
701
701
|
];
|
702
702
|
|
703
703
|
return (
|
704
|
-
<div style
|
705
|
-
<form onSubmit={onSubmit} style
|
704
|
+
<div style=\{{ display: "flex", gap: "30px", height: "300px" }}>
|
705
|
+
<form onSubmit={onSubmit} style=\{{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
706
706
|
<Select label="Select" name="Select" defaultValue={"brazil"} items={items} />
|
707
707
|
<Select label="Select" name="SelectMulti" defaultValue={["brazil"]} items={items} multiselect />
|
708
708
|
<Button type="submit">Отправить</Button>
|
@@ -77,7 +77,7 @@ export function App() {
|
|
77
77
|
}
|
78
78
|
```
|
79
79
|
|
80
|
-
|
80
|
+
## Вертикальное отображение
|
81
81
|
|
82
82
|
```tsx live
|
83
83
|
import React from 'react';
|
@@ -86,7 +86,7 @@ import { IconMic } from '@salutejs/plasma-icons';
|
|
86
86
|
|
87
87
|
export function App() {
|
88
88
|
return (
|
89
|
-
<section style
|
89
|
+
<section style=\{{ height: '300px' }}>
|
90
90
|
<Slider
|
91
91
|
onChangeCommitted={() => {}}
|
92
92
|
min={0}
|
@@ -7,7 +7,7 @@ import { PropsTable, Description } from '@site/src/components';
|
|
7
7
|
|
8
8
|
# Switch
|
9
9
|
<Description name="Switch" />
|
10
|
-
<PropsTable name="Switch" />
|
10
|
+
<PropsTable name="Switch" include={['defaultChecked']} />
|
11
11
|
|
12
12
|
## Использование
|
13
13
|
Компонент `Switch` может содержать лейбл.
|
@@ -30,7 +30,7 @@ export function App() {
|
|
30
30
|
|
31
31
|
```tsx live
|
32
32
|
import React from 'react';
|
33
|
-
import {
|
33
|
+
import { Switch } from '@salutejs/{{ package }}';
|
34
34
|
|
35
35
|
export function App() {
|
36
36
|
return (
|
@@ -47,7 +47,7 @@ export function App() {
|
|
47
47
|
|
48
48
|
```tsx live
|
49
49
|
import React from 'react';
|
50
|
-
import {
|
50
|
+
import { Switch } from '@salutejs/{{ package }}';
|
51
51
|
|
52
52
|
export function App() {
|
53
53
|
return (
|
@@ -492,7 +492,7 @@ export type TableColumnData = {
|
|
492
492
|
];
|
493
493
|
|
494
494
|
return (
|
495
|
-
<div style
|
495
|
+
<div style=\{{ display: "block" }}>
|
496
496
|
<ButtonGroup size="xs" isCommonButtonStyles={false}>
|
497
497
|
<Button text="Очистить выбранные" view="warning" size="xs" onClick={clearSelected} />
|
498
498
|
<Button text="Убрать сортировку" view="warning" size="xs" onClick={clearSorted} />
|
@@ -504,7 +504,7 @@ export type TableColumnData = {
|
|
504
504
|
<br />
|
505
505
|
<br />
|
506
506
|
|
507
|
-
<div style
|
507
|
+
<div style=\{{ overflow: "scroll" }}>
|
508
508
|
<Table
|
509
509
|
data={data}
|
510
510
|
columns={columns}
|
@@ -5,6 +5,10 @@ title: Tabs
|
|
5
5
|
|
6
6
|
import { PropsTable, Description } from '@site/src/components';
|
7
7
|
|
8
|
+
# Tabs
|
9
|
+
Набор компонентов для создания вкладок.
|
10
|
+
Структура для вкладок похожа на структуру маркированных списков.
|
11
|
+
|
8
12
|
## Tabs
|
9
13
|
|
10
14
|
<Description name="Tabs" />
|
@@ -16,7 +20,7 @@ import { PropsTable, Description } from '@site/src/components';
|
|
16
20
|
<PropsTable name="TabItem" />
|
17
21
|
|
18
22
|
:::caution Взаимоисключающие свойства
|
19
|
-
Свойство `value` - это значение
|
23
|
+
Свойство `value` - это значение Tab. Оно отображается справа от основного текста.<br/>
|
20
24
|
`value` и `contentRight` взаимоисключающие: если передано одно, второе передать нельзя.
|
21
25
|
:::
|
22
26
|
|
@@ -61,8 +65,8 @@ export function App() {
|
|
61
65
|
}
|
62
66
|
```
|
63
67
|
|
64
|
-
### Расположение
|
65
|
-
|
68
|
+
### Расположение Tabs
|
69
|
+
Компонент может быть горизонтальными (по умолчанию) и вертикальными. За это отвечает свойство `orientation`.
|
66
70
|
|
67
71
|
```tsx live
|
68
72
|
import React, { useState } from 'react';
|
@@ -97,11 +101,11 @@ export function App() {
|
|
97
101
|
```
|
98
102
|
|
99
103
|
### Пример с прокруткой
|
100
|
-
При выборе
|
104
|
+
При выборе Tab происходит прокрутка до выбранного TabItem.
|
101
105
|
|
102
106
|
```tsx live
|
103
107
|
import React, { useState } from 'react';
|
104
|
-
import { Tabs, TabItem, Button } from '@salutejs/
|
108
|
+
import { Tabs, TabItem, Button } from '@salutejs/{{ package }}';
|
105
109
|
import { IconClock } from '@salutejs/plasma-icons';
|
106
110
|
|
107
111
|
export function App() {
|
@@ -189,8 +193,8 @@ export function App() {
|
|
189
193
|
|
190
194
|
### Подключение клавиатурной навигации
|
191
195
|
Для этого необходимо дополнительно прокинуть свойства `index, itemIndex, onIndexChange`.<br/>
|
192
|
-
Для горизонтальных
|
193
|
-
Для вертикальных
|
196
|
+
Для горизонтальных Tabs: клавиши ArrowLeft, ArrowRight, Home, End для навигации по вкладкам.<br/>
|
197
|
+
Для вертикальных Tabs: клавиши ArrowUp, ArrowDown, Home, End для навигации по вкладкам.
|
194
198
|
|
195
199
|
```tsx live
|
196
200
|
import React, { useState } from 'react';
|
@@ -161,11 +161,18 @@ export function App() {
|
|
161
161
|
|
162
162
|
|
163
163
|
### Обязательность поля
|
164
|
-
|
164
|
+
|
165
|
+
:::tip
|
166
|
+
Наличие индикатора регулируется свойством `hasRequiredIndicator`.
|
167
|
+
:::
|
168
|
+
|
169
|
+
Обязательность поля задаётся с помощью свойств `required` и `requiredPlacement`.
|
170
|
+
|
171
|
+
Где `requiredPlacement` отвечает за выравнивание и принимает значения `"left"` и `"right"`:
|
165
172
|
|
166
173
|
```tsx live
|
167
174
|
import React from 'react';
|
168
|
-
import {
|
175
|
+
import { TextArea } from '@salutejs/{{ package }}';
|
169
176
|
|
170
177
|
export function App() {
|
171
178
|
return (
|