@epam/uui 4.11.0-alpha.1 → 5.0.0-alpha.1
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/assets/styles/buttonLayout.scss +5 -4
- package/assets/styles/controlLayout.scss +1 -1
- package/assets/styles/effects.scss +2 -2
- package/assets/styles/font-faces.scss +1 -1
- package/assets/styles/icons.scss +2 -2
- package/assets/styles/index.scss +1 -1
- package/assets/styles/inputs.scss +1 -1
- package/assets/styles/layout-mixins.scss +1 -1
- package/assets/styles/prettifyScrollBar.scss +1 -1
- package/assets/styles/text-layout.scss +1 -1
- package/assets/styles/typography-mixins.scss +1 -1
- package/assets/styles/typography.scss +3 -3
- package/assets/styles/variables/widgets/badge.scss +1 -1
- package/components/buttons/Button/Button.d.ts.map +1 -1
- package/components/buttons/IconButton.d.ts.map +1 -1
- package/components/buttons/LinkButton.d.ts.map +1 -1
- package/components/buttons/TabButton.d.ts.map +1 -1
- package/components/buttons/VerticalTabButton.d.ts.map +1 -1
- package/components/buttons/helper.d.ts.map +1 -1
- package/components/datePickers/Calendar.d.ts.map +1 -1
- package/components/datePickers/CalendarPresets.d.ts.map +1 -1
- package/components/datePickers/DatePicker.d.ts +3 -3
- package/components/datePickers/DatePicker.d.ts.map +1 -1
- package/components/datePickers/DatePickerBody.d.ts.map +1 -1
- package/components/datePickers/RangeDatePicker.d.ts +1 -1
- package/components/datePickers/RangeDatePicker.d.ts.map +1 -1
- package/components/datePickers/RangeDatePickerBody.d.ts.map +1 -1
- package/components/dnd/DropMarker.d.ts.map +1 -1
- package/components/filters/FilterDataPickerBody.d.ts +1 -1
- package/components/filters/FilterDataPickerBody.d.ts.map +1 -1
- package/components/filters/FilterItemBody.d.ts +3 -2
- package/components/filters/FilterItemBody.d.ts.map +1 -1
- package/components/filters/FilterNumericBody.d.ts +3 -2
- package/components/filters/FilterNumericBody.d.ts.map +1 -1
- package/components/filters/FilterPanelItemToggler.d.ts +1 -1
- package/components/filters/FilterPanelItemToggler.d.ts.map +1 -1
- package/components/filters/FilterPickerBody.d.ts +2 -4
- package/components/filters/FilterPickerBody.d.ts.map +1 -1
- package/components/filters/FilterRangeDatePickerBody.d.ts +1 -1
- package/components/filters/FilterRangeDatePickerBody.d.ts.map +1 -1
- package/components/filters/FiltersPanel.d.ts +5 -3
- package/components/filters/FiltersPanel.d.ts.map +1 -1
- package/components/filters/FiltersPanelItem.d.ts +5 -3
- package/components/filters/FiltersPanelItem.d.ts.map +1 -1
- package/components/filters/PresetPanel/Preset.d.ts +3 -2
- package/components/filters/PresetPanel/Preset.d.ts.map +1 -1
- package/components/filters/PresetPanel/PresetActionsDropdown.d.ts +3 -2
- package/components/filters/PresetPanel/PresetActionsDropdown.d.ts.map +1 -1
- package/components/filters/PresetPanel/PresetInput.d.ts +3 -2
- package/components/filters/PresetPanel/PresetInput.d.ts.map +1 -1
- package/components/filters/PresetPanel/PresetsPanel.d.ts +4 -4
- package/components/filters/PresetPanel/PresetsPanel.d.ts.map +1 -1
- package/components/filters/defaultPredicates.d.ts +1 -1
- package/components/filters/defaultPredicates.d.ts.map +1 -1
- package/components/filters/index.d.ts +4 -4
- package/components/forms/Form.d.ts.map +1 -1
- package/components/forms/useForm.d.ts +1 -1
- package/components/forms/useForm.d.ts.map +1 -1
- package/components/inputs/Checkbox.d.ts.map +1 -1
- package/components/inputs/NumericInput.d.ts +3 -3
- package/components/inputs/NumericInput.d.ts.map +1 -1
- package/components/inputs/RadioInput.d.ts.map +1 -1
- package/components/inputs/Switch.d.ts.map +1 -1
- package/components/inputs/TextArea.d.ts.map +1 -1
- package/components/inputs/TextInput.d.ts +1 -1
- package/components/inputs/TextInput.d.ts.map +1 -1
- package/components/layout/Accordion.d.ts.map +1 -1
- package/components/layout/Blocker.d.ts.map +1 -1
- package/components/layout/FlexItems/FlexCell.d.ts.map +1 -1
- package/components/layout/FlexItems/FlexRow.d.ts +1 -2
- package/components/layout/FlexItems/FlexRow.d.ts.map +1 -1
- package/components/layout/FlexItems/Panel.d.ts.map +1 -1
- package/components/layout/FlexItems/index.d.ts +1 -1
- package/components/layout/FlexItems/index.d.ts.map +1 -1
- package/components/layout/LabeledInput.d.ts.map +1 -1
- package/components/layout/RadioGroup.d.ts.map +1 -1
- package/components/layout/ScrollBars.d.ts.map +1 -1
- package/components/navigation/Anchor.d.ts +3 -0
- package/components/navigation/Anchor.d.ts.map +1 -0
- package/components/navigation/MainMenu/Burger/Burger.d.ts.map +1 -1
- package/components/navigation/MainMenu/Burger/BurgerButton.d.ts.map +1 -1
- package/components/navigation/MainMenu/Burger/BurgerGroupHeader.d.ts +2 -1
- package/components/navigation/MainMenu/Burger/BurgerGroupHeader.d.ts.map +1 -1
- package/components/navigation/MainMenu/Burger/BurgerSearch.d.ts +2 -1
- package/components/navigation/MainMenu/Burger/BurgerSearch.d.ts.map +1 -1
- package/components/navigation/MainMenu/GlobalMenu.d.ts +2 -2
- package/components/navigation/MainMenu/GlobalMenu.d.ts.map +1 -1
- package/components/navigation/MainMenu/MainMenuAvatar.d.ts +1 -1
- package/components/navigation/MainMenu/MainMenuAvatar.d.ts.map +1 -1
- package/components/navigation/MainMenu/MainMenuButton.d.ts.map +1 -1
- package/components/navigation/MainMenu/MainMenuSearch.d.ts +1 -1
- package/components/navigation/MainMenu/MainMenuSearch.d.ts.map +1 -1
- package/components/navigation/index.d.ts +1 -0
- package/components/navigation/index.d.ts.map +1 -1
- package/components/overlays/Alert.d.ts.map +1 -1
- package/components/overlays/ConfirmationModal.d.ts.map +1 -1
- package/components/overlays/Dropdown.d.ts.map +1 -1
- package/components/overlays/DropdownContainer.d.ts.map +1 -1
- package/components/overlays/DropdownMenu.d.ts +4 -4
- package/components/overlays/DropdownMenu.d.ts.map +1 -1
- package/components/overlays/Modals.d.ts.map +1 -1
- package/components/overlays/NotificationCard.d.ts.map +1 -1
- package/components/overlays/Tooltip.d.ts +4 -2
- package/components/overlays/Tooltip.d.ts.map +1 -1
- package/components/overlays/index.d.ts +1 -0
- package/components/overlays/index.d.ts.map +1 -1
- package/components/pickers/DataPickerBody.d.ts.map +1 -1
- package/components/pickers/DataPickerFooter.d.ts +4 -3
- package/components/pickers/DataPickerFooter.d.ts.map +1 -1
- package/components/pickers/DataPickerHeader.d.ts.map +1 -1
- package/components/pickers/DataPickerRow.d.ts.map +1 -1
- package/components/pickers/MobileDropdownWrapper.d.ts.map +1 -1
- package/components/pickers/PickerInput.d.ts +1 -1
- package/components/pickers/PickerInput.d.ts.map +1 -1
- package/components/pickers/PickerItem.d.ts.map +1 -1
- package/components/pickers/PickerList.d.ts +2 -2
- package/components/pickers/PickerList.d.ts.map +1 -1
- package/components/pickers/PickerListItem.d.ts.map +1 -1
- package/components/pickers/PickerModal.d.ts +1 -1
- package/components/pickers/PickerModal.d.ts.map +1 -1
- package/components/pickers/PickerToggler.d.ts.map +1 -1
- package/components/pickers/helpers.d.ts +2 -0
- package/components/pickers/helpers.d.ts.map +1 -0
- package/components/tables/ColumnHeaderDropdown/ColumnHeaderDropdown.d.ts +1 -1
- package/components/tables/ColumnHeaderDropdown/ColumnHeaderDropdown.d.ts.map +1 -1
- package/components/tables/ColumnHeaderDropdown/SortingPanel.d.ts +2 -2
- package/components/tables/ColumnHeaderDropdown/SortingPanel.d.ts.map +1 -1
- package/components/tables/ColumnHeaderDropdown/index.d.ts +1 -1
- package/components/tables/DataTable.d.ts.map +1 -1
- package/components/tables/DataTableCell.d.ts.map +1 -1
- package/components/tables/DataTableHeaderCell.d.ts.map +1 -1
- package/components/tables/DataTableHeaderRow.d.ts.map +1 -1
- package/components/tables/DataTableRow.d.ts.map +1 -1
- package/components/tables/columnsConfigurationModal/ColumnRow.d.ts +2 -2
- package/components/tables/columnsConfigurationModal/ColumnRow.d.ts.map +1 -1
- package/components/tables/columnsConfigurationModal/ColumnsConfigurationModal.d.ts +1 -1
- package/components/tables/columnsConfigurationModal/ColumnsConfigurationModal.d.ts.map +1 -1
- package/components/tables/columnsConfigurationModal/PinIconButton.d.ts.map +1 -1
- package/components/tables/types.d.ts +0 -4
- package/components/tables/types.d.ts.map +1 -1
- package/components/types.d.ts +2 -0
- package/components/types.d.ts.map +1 -1
- package/components/typography/RichTextView.d.ts.map +1 -1
- package/components/typography/Text.d.ts.map +1 -1
- package/components/typography/TextPlaceholder.d.ts +2 -2
- package/components/typography/TextPlaceholder.d.ts.map +1 -1
- package/components/widgets/AvatarStack.d.ts +4 -0
- package/components/widgets/AvatarStack.d.ts.map +1 -0
- package/components/widgets/Badge.d.ts +1 -1
- package/components/widgets/Badge.d.ts.map +1 -1
- package/components/widgets/Paginator.d.ts +4 -0
- package/components/widgets/Paginator.d.ts.map +1 -0
- package/components/widgets/Spinner.d.ts.map +1 -1
- package/components/widgets/Tag.d.ts.map +1 -1
- package/components/widgets/index.d.ts +2 -0
- package/components/widgets/index.d.ts.map +1 -1
- package/helpers/index.d.ts +2 -2
- package/helpers/textLayout.d.ts.map +1 -1
- package/helpers/useColumnsWithFilters.d.ts +1 -1
- package/helpers/useColumnsWithFilters.d.ts.map +1 -1
- package/icons/icons.d.ts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.esm.js +3665 -0
- package/index.esm.js.map +1 -0
- package/index.js +1128 -1042
- package/index.js.map +1 -1
- package/package.json +11 -10
- package/readme.md +2 -2
- package/stats.html +2462 -329
- package/styles.css +681 -744
- package/styles.css.map +1 -1
- package/components/buttons/Button/Button.test.d.ts +0 -2
- package/components/buttons/Button/Button.test.d.ts.map +0 -1
- package/components/layout/FlexItems/FlexSpacer.d.ts +0 -5
- package/components/layout/FlexItems/FlexSpacer.d.ts.map +0 -1
package/index.esm.js
ADDED
|
@@ -0,0 +1,3665 @@
|
|
|
1
|
+
import { Button as Button$1, IconButton as IconButton$1, Checkbox as Checkbox$1, RadioInput as RadioInput$1, Switch as Switch$1, TextInput as TextInput$1, Accordion as Accordion$1, ControlGroup as ControlGroup$1, FlexCell as FlexCell$1, FlexRow as FlexRow$1, VPanel, IconContainer, Dropdown as Dropdown$1, DropdownContainer as DropdownContainer$1, Anchor as Anchor$1, Text as Text$1, FlexSpacer, RichTextView as RichTextView$1, ModalBlocker as ModalBlocker$1, ModalWindow as ModalWindow$1, Tooltip as Tooltip$1, LabeledInput as LabeledInput$1, RadioGroup as RadioGroup$1, ScrollBars as ScrollBars$1, VirtualList as VirtualList$1, Spinner as Spinner$1, Blocker as Blocker$1, CheckboxGroup as CheckboxGroup$1, NumericInput as NumericInput$1, TextArea as TextArea$1, DatePickerBody as DatePickerBody$1, BaseDatePicker, Calendar as Calendar$1, RangeDatePickerBody as RangeDatePickerBody$1, BaseRangeDatePicker, PickerBodyBase, DataTableCell as DataTableCell$1, DragHandle, DataTableRow as DataTableRow$1, DataTableHeaderRow as DataTableHeaderRow$1, DataTableHeaderCell as DataTableHeaderCell$1, DataTableSelectionProvider, useColumnsConfiguration, DataPickerRow as DataPickerRow$1, PickerModalBase, handleDataSourceKeyboard, Avatar as Avatar$1, AvatarStack as AvatarStack$1, Paginator as Paginator$1, PickerToggler as PickerToggler$1, PickerInputBase, PickerListBase, AdaptivePanel, MainMenu as MainMenu$1, Burger as Burger$1 } from '@epam/uui-components';
|
|
2
|
+
export { FlexSpacer, IconContainer } from '@epam/uui-components';
|
|
3
|
+
import { withMods, IEditableDebouncer, UuiContext, cx as cx$1, uuiMod, i18n as i18n$1, Lens, isMobile, uuiMarkers, uuiDataTableHeaderCell, useUuiContext, useColumnsConfig, uuiScrollShadows, DndActor, mobilePopperModifier, useAppMobileHeight, uuiElement, useForceUpdate, getSeparatedValue, useArrayDataSource, getOrderBetween, Form as Form$1, useForm as useForm$1 } from '@epam/uui-core';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import React__default, { forwardRef, useContext, useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
6
|
+
import cx from 'classnames';
|
|
7
|
+
import FocusLock from 'react-focus-lock';
|
|
8
|
+
import sortBy from 'lodash.sortby';
|
|
9
|
+
|
|
10
|
+
var _path$11;
|
|
11
|
+
function _extends$14() { _extends$14 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$14.apply(this, arguments); }
|
|
12
|
+
var SvgBtnCross12 = function SvgBtnCross12(props, ref) {
|
|
13
|
+
return /*#__PURE__*/React.createElement("svg", _extends$14({
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
width: 12,
|
|
16
|
+
height: 12,
|
|
17
|
+
viewBox: "0 0 12 12",
|
|
18
|
+
ref: ref
|
|
19
|
+
}, props), _path$11 || (_path$11 = /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
d: "M9.5 3.205 8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6z"
|
|
22
|
+
})));
|
|
23
|
+
};
|
|
24
|
+
var ForwardRef$14 = /*#__PURE__*/forwardRef(SvgBtnCross12);
|
|
25
|
+
|
|
26
|
+
var _path$10;
|
|
27
|
+
function _extends$13() { _extends$13 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$13.apply(this, arguments); }
|
|
28
|
+
var SvgBtnCross18 = function SvgBtnCross18(props, ref) {
|
|
29
|
+
return /*#__PURE__*/React.createElement("svg", _extends$13({
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
width: 18,
|
|
32
|
+
height: 18,
|
|
33
|
+
viewBox: "0 0 18 18",
|
|
34
|
+
ref: ref
|
|
35
|
+
}, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
|
|
36
|
+
fillRule: "evenodd",
|
|
37
|
+
d: "M14.25 4.808 13.193 3.75 9 7.942 4.808 3.75 3.75 4.808 7.942 9 3.75 13.193l1.058 1.057L9 10.057l4.193 4.193 1.057-1.057L10.057 9z"
|
|
38
|
+
})));
|
|
39
|
+
};
|
|
40
|
+
var ForwardRef$13 = /*#__PURE__*/forwardRef(SvgBtnCross18);
|
|
41
|
+
|
|
42
|
+
var _path$$;
|
|
43
|
+
function _extends$12() { _extends$12 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$12.apply(this, arguments); }
|
|
44
|
+
var SvgBtnCross24 = function SvgBtnCross24(props, ref) {
|
|
45
|
+
return /*#__PURE__*/React.createElement("svg", _extends$12({
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
width: 24,
|
|
48
|
+
height: 24,
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
ref: ref
|
|
51
|
+
}, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
|
|
52
|
+
fillRule: "evenodd",
|
|
53
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
54
|
+
})));
|
|
55
|
+
};
|
|
56
|
+
var ForwardRef$12 = /*#__PURE__*/forwardRef(SvgBtnCross24);
|
|
57
|
+
|
|
58
|
+
var _path$_;
|
|
59
|
+
function _extends$11() { _extends$11 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$11.apply(this, arguments); }
|
|
60
|
+
var SvgFoldingArrow12 = function SvgFoldingArrow12(props, ref) {
|
|
61
|
+
return /*#__PURE__*/React.createElement("svg", _extends$11({
|
|
62
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
+
width: 12,
|
|
64
|
+
height: 12,
|
|
65
|
+
viewBox: "0 0 12 12",
|
|
66
|
+
ref: ref
|
|
67
|
+
}, props), _path$_ || (_path$_ = /*#__PURE__*/React.createElement("path", {
|
|
68
|
+
fillRule: "evenodd",
|
|
69
|
+
d: "M8.295 4.295 6 6.585l-2.295-2.29L3 5l3 3 3-3z"
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
72
|
+
var ForwardRef$11 = /*#__PURE__*/forwardRef(SvgFoldingArrow12);
|
|
73
|
+
|
|
74
|
+
var _path$Z;
|
|
75
|
+
function _extends$10() { _extends$10 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$10.apply(this, arguments); }
|
|
76
|
+
var SvgFoldingArrow18 = function SvgFoldingArrow18(props, ref) {
|
|
77
|
+
return /*#__PURE__*/React.createElement("svg", _extends$10({
|
|
78
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
79
|
+
width: 18,
|
|
80
|
+
height: 18,
|
|
81
|
+
viewBox: "0 0 18 18",
|
|
82
|
+
ref: ref
|
|
83
|
+
}, props), _path$Z || (_path$Z = /*#__PURE__*/React.createElement("path", {
|
|
84
|
+
fillRule: "evenodd",
|
|
85
|
+
d: "M12.443 6.442 9 9.877 5.558 6.442 4.5 7.5 9 12l4.5-4.5z"
|
|
86
|
+
})));
|
|
87
|
+
};
|
|
88
|
+
var ForwardRef$10 = /*#__PURE__*/forwardRef(SvgFoldingArrow18);
|
|
89
|
+
|
|
90
|
+
var _path$Y;
|
|
91
|
+
function _extends$$() { _extends$$ = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$$.apply(this, arguments); }
|
|
92
|
+
var SvgFoldingArrow24 = function SvgFoldingArrow24(props, ref) {
|
|
93
|
+
return /*#__PURE__*/React.createElement("svg", _extends$$({
|
|
94
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
95
|
+
width: 24,
|
|
96
|
+
height: 24,
|
|
97
|
+
viewBox: "0 0 24 24",
|
|
98
|
+
ref: ref
|
|
99
|
+
}, props), _path$Y || (_path$Y = /*#__PURE__*/React.createElement("path", {
|
|
100
|
+
fillRule: "evenodd",
|
|
101
|
+
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
102
|
+
})));
|
|
103
|
+
};
|
|
104
|
+
var ForwardRef$$ = /*#__PURE__*/forwardRef(SvgFoldingArrow24);
|
|
105
|
+
|
|
106
|
+
var _path$X;
|
|
107
|
+
function _extends$_() { _extends$_ = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$_.apply(this, arguments); }
|
|
108
|
+
var SvgAccept12 = function SvgAccept12(props, ref) {
|
|
109
|
+
return /*#__PURE__*/React.createElement("svg", _extends$_({
|
|
110
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
111
|
+
width: 12,
|
|
112
|
+
height: 12,
|
|
113
|
+
viewBox: "0 0 12 12",
|
|
114
|
+
ref: ref
|
|
115
|
+
}, props), _path$X || (_path$X = /*#__PURE__*/React.createElement("path", {
|
|
116
|
+
fillRule: "evenodd",
|
|
117
|
+
d: "M4.846 6.8 9.462 2 11 3.6 4.846 10l-.77-.8L1 6l1.538-1.6 2.308 2.4z"
|
|
118
|
+
})));
|
|
119
|
+
};
|
|
120
|
+
var ForwardRef$_ = /*#__PURE__*/forwardRef(SvgAccept12);
|
|
121
|
+
|
|
122
|
+
var _path$W;
|
|
123
|
+
function _extends$Z() { _extends$Z = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Z.apply(this, arguments); }
|
|
124
|
+
var SvgAccept18 = function SvgAccept18(props, ref) {
|
|
125
|
+
return /*#__PURE__*/React.createElement("svg", _extends$Z({
|
|
126
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
127
|
+
width: 18,
|
|
128
|
+
height: 18,
|
|
129
|
+
viewBox: "0 0 18 18",
|
|
130
|
+
ref: ref
|
|
131
|
+
}, props), _path$W || (_path$W = /*#__PURE__*/React.createElement("path", {
|
|
132
|
+
fillRule: "evenodd",
|
|
133
|
+
d: "M7.136 11.91 4.034 8.776 3 9.821 7.136 14 16 5.045 14.966 4z"
|
|
134
|
+
})));
|
|
135
|
+
};
|
|
136
|
+
var ForwardRef$Z = /*#__PURE__*/forwardRef(SvgAccept18);
|
|
137
|
+
|
|
138
|
+
var _path$V;
|
|
139
|
+
function _extends$Y() { _extends$Y = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Y.apply(this, arguments); }
|
|
140
|
+
var SvgAccept24 = function SvgAccept24(props, ref) {
|
|
141
|
+
return /*#__PURE__*/React.createElement("svg", _extends$Y({
|
|
142
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
143
|
+
width: 24,
|
|
144
|
+
height: 24,
|
|
145
|
+
viewBox: "0 0 24 24",
|
|
146
|
+
ref: ref
|
|
147
|
+
}, props), _path$V || (_path$V = /*#__PURE__*/React.createElement("path", {
|
|
148
|
+
fillRule: "evenodd",
|
|
149
|
+
d: "m9.727 16.075-4.295-4.388L4 13.149 9.727 19 22 6.463 20.568 5z"
|
|
150
|
+
})));
|
|
151
|
+
};
|
|
152
|
+
var ForwardRef$Y = /*#__PURE__*/forwardRef(SvgAccept24);
|
|
153
|
+
|
|
154
|
+
var _path$U;
|
|
155
|
+
function _extends$X() { _extends$X = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$X.apply(this, arguments); }
|
|
156
|
+
var SvgSearch12 = function SvgSearch12(props, ref) {
|
|
157
|
+
return /*#__PURE__*/React.createElement("svg", _extends$X({
|
|
158
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
159
|
+
width: 12,
|
|
160
|
+
height: 12,
|
|
161
|
+
viewBox: "0 0 12 12",
|
|
162
|
+
ref: ref
|
|
163
|
+
}, props), _path$U || (_path$U = /*#__PURE__*/React.createElement("path", {
|
|
164
|
+
fillRule: "evenodd",
|
|
165
|
+
d: "M9.016 8.309 10.707 10l-.707.707-1.691-1.691a4.5 4.5 0 1 1 .707-.707zM5.5 9a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"
|
|
166
|
+
})));
|
|
167
|
+
};
|
|
168
|
+
var ForwardRef$X = /*#__PURE__*/forwardRef(SvgSearch12);
|
|
169
|
+
|
|
170
|
+
var _path$T;
|
|
171
|
+
function _extends$W() { _extends$W = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$W.apply(this, arguments); }
|
|
172
|
+
var SvgSearch18 = function SvgSearch18(props, ref) {
|
|
173
|
+
return /*#__PURE__*/React.createElement("svg", _extends$W({
|
|
174
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
175
|
+
width: 18,
|
|
176
|
+
height: 18,
|
|
177
|
+
viewBox: "0 0 18 18",
|
|
178
|
+
ref: ref
|
|
179
|
+
}, props), _path$T || (_path$T = /*#__PURE__*/React.createElement("path", {
|
|
180
|
+
fillRule: "evenodd",
|
|
181
|
+
d: "M13.749 12.335 16.414 15 15 16.414l-2.665-2.665a6.5 6.5 0 1 1 1.414-1.414zM8.5 13a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9z"
|
|
182
|
+
})));
|
|
183
|
+
};
|
|
184
|
+
var ForwardRef$W = /*#__PURE__*/forwardRef(SvgSearch18);
|
|
185
|
+
|
|
186
|
+
var _path$S;
|
|
187
|
+
function _extends$V() { _extends$V = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$V.apply(this, arguments); }
|
|
188
|
+
var SvgSearch24 = function SvgSearch24(props, ref) {
|
|
189
|
+
return /*#__PURE__*/React.createElement("svg", _extends$V({
|
|
190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
191
|
+
width: 24,
|
|
192
|
+
height: 24,
|
|
193
|
+
viewBox: "0 0 24 24",
|
|
194
|
+
ref: ref
|
|
195
|
+
}, props), _path$S || (_path$S = /*#__PURE__*/React.createElement("path", {
|
|
196
|
+
fillRule: "evenodd",
|
|
197
|
+
d: "M17.32 15.906 21.414 20 20 21.414l-4.094-4.094a8 8 0 1 1 1.414-1.414zM11 17a6 6 0 1 0 0-12 6 6 0 0 0 0 12z"
|
|
198
|
+
})));
|
|
199
|
+
};
|
|
200
|
+
var ForwardRef$V = /*#__PURE__*/forwardRef(SvgSearch24);
|
|
201
|
+
|
|
202
|
+
var _path$R;
|
|
203
|
+
function _extends$U() { _extends$U = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$U.apply(this, arguments); }
|
|
204
|
+
var SvgCalendar12 = function SvgCalendar12(props, ref) {
|
|
205
|
+
return /*#__PURE__*/React.createElement("svg", _extends$U({
|
|
206
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
207
|
+
width: 12,
|
|
208
|
+
height: 12,
|
|
209
|
+
viewBox: "0 0 12 12",
|
|
210
|
+
ref: ref
|
|
211
|
+
}, props), _path$R || (_path$R = /*#__PURE__*/React.createElement("path", {
|
|
212
|
+
fillRule: "evenodd",
|
|
213
|
+
d: "M10 2H9V1H8v1H4V1H3v1H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 8H2V4h8v6z"
|
|
214
|
+
})));
|
|
215
|
+
};
|
|
216
|
+
var ForwardRef$U = /*#__PURE__*/forwardRef(SvgCalendar12);
|
|
217
|
+
|
|
218
|
+
var _path$Q;
|
|
219
|
+
function _extends$T() { _extends$T = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$T.apply(this, arguments); }
|
|
220
|
+
var SvgCalendar18 = function SvgCalendar18(props, ref) {
|
|
221
|
+
return /*#__PURE__*/React.createElement("svg", _extends$T({
|
|
222
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
223
|
+
width: 18,
|
|
224
|
+
height: 18,
|
|
225
|
+
viewBox: "0 0 18 18",
|
|
226
|
+
ref: ref
|
|
227
|
+
}, props), _path$Q || (_path$Q = /*#__PURE__*/React.createElement("path", {
|
|
228
|
+
fillRule: "evenodd",
|
|
229
|
+
d: "M14 3V1h-2v2H6V1H4v2C3 3 2 4 2 5v10c0 1 1 2 2 2h10c1 0 2-1 2-2V5c0-1-1-2-2-2zm0 12-10 .048V7h10v8z"
|
|
230
|
+
})));
|
|
231
|
+
};
|
|
232
|
+
var ForwardRef$T = /*#__PURE__*/forwardRef(SvgCalendar18);
|
|
233
|
+
|
|
234
|
+
var _path$P;
|
|
235
|
+
function _extends$S() { _extends$S = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$S.apply(this, arguments); }
|
|
236
|
+
var SvgCalendar24 = function SvgCalendar24(props, ref) {
|
|
237
|
+
return /*#__PURE__*/React.createElement("svg", _extends$S({
|
|
238
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
239
|
+
width: 24,
|
|
240
|
+
height: 24,
|
|
241
|
+
viewBox: "0 0 24 24",
|
|
242
|
+
ref: ref
|
|
243
|
+
}, props), _path$P || (_path$P = /*#__PURE__*/React.createElement("path", {
|
|
244
|
+
fillRule: "evenodd",
|
|
245
|
+
d: "M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"
|
|
246
|
+
})));
|
|
247
|
+
};
|
|
248
|
+
var ForwardRef$S = /*#__PURE__*/forwardRef(SvgCalendar24);
|
|
249
|
+
|
|
250
|
+
var _path$O;
|
|
251
|
+
function _extends$R() { _extends$R = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$R.apply(this, arguments); }
|
|
252
|
+
var SvgInfo12 = function SvgInfo12(props, ref) {
|
|
253
|
+
return /*#__PURE__*/React.createElement("svg", _extends$R({
|
|
254
|
+
width: 12,
|
|
255
|
+
height: 12,
|
|
256
|
+
viewBox: "0 0 12 12",
|
|
257
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
258
|
+
ref: ref
|
|
259
|
+
}, props), _path$O || (_path$O = /*#__PURE__*/React.createElement("path", {
|
|
260
|
+
d: "M6 1C3.24 1 1 3.24 1 6s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm1 8H5V5h2zm0-5c-.471.471-1.529.471-2 0s-.471-1.529 0-2 1.529-.471 2 0 .471 1.529 0 2z",
|
|
261
|
+
fillRule: "evenodd"
|
|
262
|
+
})));
|
|
263
|
+
};
|
|
264
|
+
var ForwardRef$R = /*#__PURE__*/forwardRef(SvgInfo12);
|
|
265
|
+
|
|
266
|
+
var _path$N;
|
|
267
|
+
function _extends$Q() { _extends$Q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Q.apply(this, arguments); }
|
|
268
|
+
var SvgInfo18 = function SvgInfo18(props, ref) {
|
|
269
|
+
return /*#__PURE__*/React.createElement("svg", _extends$Q({
|
|
270
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
271
|
+
width: 18,
|
|
272
|
+
height: 18,
|
|
273
|
+
viewBox: "0 0 18 18",
|
|
274
|
+
ref: ref
|
|
275
|
+
}, props), _path$N || (_path$N = /*#__PURE__*/React.createElement("path", {
|
|
276
|
+
fillRule: "evenodd",
|
|
277
|
+
d: "M8 13h2V8H8v5zM9 1C4.584 1 1 4.584 1 9s3.584 8 8 8 8-3.584 8-8-3.584-8-8-8zm0 15c-3.859 0-7-3.141-7-7s3.141-7 7-7 7 3.141 7 7-3.141 7-7 7zM8 7h2V5H8v2z"
|
|
278
|
+
})));
|
|
279
|
+
};
|
|
280
|
+
var ForwardRef$Q = /*#__PURE__*/forwardRef(SvgInfo18);
|
|
281
|
+
|
|
282
|
+
var _path$M;
|
|
283
|
+
function _extends$P() { _extends$P = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$P.apply(this, arguments); }
|
|
284
|
+
var SvgInfo24 = function SvgInfo24(props, ref) {
|
|
285
|
+
return /*#__PURE__*/React.createElement("svg", _extends$P({
|
|
286
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
287
|
+
width: 24,
|
|
288
|
+
height: 24,
|
|
289
|
+
viewBox: "0 0 24 24",
|
|
290
|
+
ref: ref
|
|
291
|
+
}, props), _path$M || (_path$M = /*#__PURE__*/React.createElement("path", {
|
|
292
|
+
fillRule: "evenodd",
|
|
293
|
+
d: "M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"
|
|
294
|
+
})));
|
|
295
|
+
};
|
|
296
|
+
var ForwardRef$P = /*#__PURE__*/forwardRef(SvgInfo24);
|
|
297
|
+
|
|
298
|
+
var _path$L;
|
|
299
|
+
function _extends$O() { _extends$O = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$O.apply(this, arguments); }
|
|
300
|
+
var SvgHelpFill10 = function SvgHelpFill10(props, ref) {
|
|
301
|
+
return /*#__PURE__*/React.createElement("svg", _extends$O({
|
|
302
|
+
width: 10,
|
|
303
|
+
height: 10,
|
|
304
|
+
viewBox: "0 0 10 10",
|
|
305
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
306
|
+
ref: ref
|
|
307
|
+
}, props), _path$L || (_path$L = /*#__PURE__*/React.createElement("path", {
|
|
308
|
+
d: "M5 0C2.24 0 0 2.24 0 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5Zm.5 7.5h-1v-3h1v3Zm0-4h-1v-1h1v1Z"
|
|
309
|
+
})));
|
|
310
|
+
};
|
|
311
|
+
var ForwardRef$O = /*#__PURE__*/forwardRef(SvgHelpFill10);
|
|
312
|
+
|
|
313
|
+
var _path$K;
|
|
314
|
+
function _extends$N() { _extends$N = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$N.apply(this, arguments); }
|
|
315
|
+
var SvgHelpFill16 = function SvgHelpFill16(props, ref) {
|
|
316
|
+
return /*#__PURE__*/React.createElement("svg", _extends$N({
|
|
317
|
+
width: 16,
|
|
318
|
+
height: 16,
|
|
319
|
+
viewBox: "0 0 16 16",
|
|
320
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
321
|
+
ref: ref
|
|
322
|
+
}, props), _path$K || (_path$K = /*#__PURE__*/React.createElement("path", {
|
|
323
|
+
d: "M7 12h2V7H7v5ZM8 0C3.584 0 0 3.584 0 8s3.584 8 8 8 8-3.584 8-8-3.584-8-8-8Zm0 15c-3.859 0-7-3.141-7-7s3.141-7 7-7 7 3.141 7 7-3.141 7-7 7ZM7 6h2V4H7v2Z"
|
|
324
|
+
})));
|
|
325
|
+
};
|
|
326
|
+
var ForwardRef$N = /*#__PURE__*/forwardRef(SvgHelpFill16);
|
|
327
|
+
|
|
328
|
+
const systemIcons = {
|
|
329
|
+
18: {
|
|
330
|
+
clear: ForwardRef$14,
|
|
331
|
+
foldingArrow: ForwardRef$11,
|
|
332
|
+
accept: ForwardRef$_,
|
|
333
|
+
search: ForwardRef$X,
|
|
334
|
+
calendar: ForwardRef$U,
|
|
335
|
+
info: ForwardRef$R,
|
|
336
|
+
help: ForwardRef$O,
|
|
337
|
+
},
|
|
338
|
+
24: {
|
|
339
|
+
clear: ForwardRef$14,
|
|
340
|
+
foldingArrow: ForwardRef$11,
|
|
341
|
+
accept: ForwardRef$_,
|
|
342
|
+
search: ForwardRef$X,
|
|
343
|
+
calendar: ForwardRef$U,
|
|
344
|
+
info: ForwardRef$R,
|
|
345
|
+
help: ForwardRef$O,
|
|
346
|
+
},
|
|
347
|
+
30: {
|
|
348
|
+
clear: ForwardRef$13,
|
|
349
|
+
foldingArrow: ForwardRef$10,
|
|
350
|
+
accept: ForwardRef$Z,
|
|
351
|
+
search: ForwardRef$W,
|
|
352
|
+
calendar: ForwardRef$T,
|
|
353
|
+
info: ForwardRef$Q,
|
|
354
|
+
help: ForwardRef$O,
|
|
355
|
+
},
|
|
356
|
+
36: {
|
|
357
|
+
clear: ForwardRef$13,
|
|
358
|
+
foldingArrow: ForwardRef$10,
|
|
359
|
+
accept: ForwardRef$Z,
|
|
360
|
+
search: ForwardRef$W,
|
|
361
|
+
calendar: ForwardRef$T,
|
|
362
|
+
info: ForwardRef$Q,
|
|
363
|
+
help: ForwardRef$N,
|
|
364
|
+
},
|
|
365
|
+
42: {
|
|
366
|
+
clear: ForwardRef$13,
|
|
367
|
+
foldingArrow: ForwardRef$10,
|
|
368
|
+
accept: ForwardRef$Z,
|
|
369
|
+
search: ForwardRef$W,
|
|
370
|
+
calendar: ForwardRef$T,
|
|
371
|
+
info: ForwardRef$Q,
|
|
372
|
+
help: ForwardRef$N,
|
|
373
|
+
},
|
|
374
|
+
48: {
|
|
375
|
+
clear: ForwardRef$12,
|
|
376
|
+
foldingArrow: ForwardRef$$,
|
|
377
|
+
accept: ForwardRef$Y,
|
|
378
|
+
search: ForwardRef$V,
|
|
379
|
+
calendar: ForwardRef$S,
|
|
380
|
+
info: ForwardRef$P,
|
|
381
|
+
help: ForwardRef$N,
|
|
382
|
+
},
|
|
383
|
+
60: {
|
|
384
|
+
clear: ForwardRef$12,
|
|
385
|
+
foldingArrow: ForwardRef$$,
|
|
386
|
+
accept: ForwardRef$Y,
|
|
387
|
+
search: ForwardRef$V,
|
|
388
|
+
calendar: ForwardRef$S,
|
|
389
|
+
info: ForwardRef$P,
|
|
390
|
+
help: ForwardRef$N,
|
|
391
|
+
},
|
|
392
|
+
none: {
|
|
393
|
+
clear: ForwardRef$13,
|
|
394
|
+
foldingArrow: ForwardRef$10,
|
|
395
|
+
accept: ForwardRef$Z,
|
|
396
|
+
search: ForwardRef$W,
|
|
397
|
+
calendar: ForwardRef$T,
|
|
398
|
+
info: ForwardRef$Q,
|
|
399
|
+
help: ForwardRef$N,
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
var buttonCss = {"typography-header":"Button_typography-header__N39Sj","typography-block":"Button_typography-block__wNgIs","typography-inline":"Button_typography-inline__rkIhO","typography-16":"Button_typography-16__zilSM","typography-14":"Button_typography-14__TkTJy","typography-12":"Button_typography-12__qT2zs","typography-promo":"Button_typography-promo__34xBe Button_typography-header__N39Sj Button_typography-block__wNgIs Button_typography-inline__rkIhO","root":"Button_root__uIzk9","mode-solid":"Button_mode-solid__zr23o","mode-outline":"Button_mode-outline__e9LiF","mode-none":"Button_mode-none__j8rJ3","mode-ghost":"Button_mode-ghost__c8QtK","size-18":"Button_size-18__Tawje","size-24":"Button_size-24__8SJZp","size-30":"Button_size-30__z1sFR","size-36":"Button_size-36__7ldWy","size-42":"Button_size-42__h3Y-0","size-48":"Button_size-48__VaI4-","typographyHeader":"Button_typography-header__N39Sj","typographyBlock":"Button_typography-block__wNgIs","typographyInline":"Button_typography-inline__rkIhO","typography16":"Button_typography-16__zilSM","typography14":"Button_typography-14__TkTJy","typography12":"Button_typography-12__qT2zs","typographyPromo":"Button_typography-promo__34xBe Button_typography-header__N39Sj Button_typography-block__wNgIs Button_typography-inline__rkIhO","modeSolid":"Button_mode-solid__zr23o","modeOutline":"Button_mode-outline__e9LiF","modeNone":"Button_mode-none__j8rJ3","modeGhost":"Button_mode-ghost__c8QtK","size18":"Button_size-18__Tawje","size24":"Button_size-24__8SJZp","size30":"Button_size-30__z1sFR","size36":"Button_size-36__7ldWy","size42":"Button_size-42__h3Y-0","size48":"Button_size-48__VaI4-"};
|
|
404
|
+
|
|
405
|
+
const allButtonColors = [
|
|
406
|
+
'accent', 'primary', 'secondary', 'negative',
|
|
407
|
+
];
|
|
408
|
+
const defaultSize$a = '36';
|
|
409
|
+
function applyButtonMods(mods) {
|
|
410
|
+
return [
|
|
411
|
+
`button-${mods.color || 'primary'}`,
|
|
412
|
+
buttonCss.root,
|
|
413
|
+
buttonCss[`size-${mods.size || defaultSize$a}`],
|
|
414
|
+
buttonCss[`mode-${mods.mode || 'solid'}`],
|
|
415
|
+
];
|
|
416
|
+
}
|
|
417
|
+
const Button = withMods(Button$1, applyButtonMods, (props) => ({
|
|
418
|
+
dropdownIcon: systemIcons[props.size || defaultSize$a].foldingArrow,
|
|
419
|
+
clearIcon: systemIcons[props.size || defaultSize$a].clear,
|
|
420
|
+
}));
|
|
421
|
+
|
|
422
|
+
var css$13 = {"root":"IconButton_root__c1hRd"};
|
|
423
|
+
|
|
424
|
+
const allIconColors = [
|
|
425
|
+
'info', 'success', 'warning', 'error', 'secondary', 'default',
|
|
426
|
+
];
|
|
427
|
+
function applyIconButtonMods(mods) {
|
|
428
|
+
return [`icon-button-${mods.color || 'default'}`, css$13.root];
|
|
429
|
+
}
|
|
430
|
+
const IconButton = withMods(IconButton$1, applyIconButtonMods);
|
|
431
|
+
|
|
432
|
+
var css$12 = {"root":"LinkButton_root__SWC7c","size-18":"LinkButton_size-18__XI44N","size-24":"LinkButton_size-24__yj-DG","size-30":"LinkButton_size-30__sKZ9H","size-36":"LinkButton_size-36__HIbgO","size-42":"LinkButton_size-42__apHCj","size-48":"LinkButton_size-48__7zgFe","size18":"LinkButton_size-18__XI44N","size24":"LinkButton_size-24__yj-DG","size30":"LinkButton_size-30__sKZ9H","size36":"LinkButton_size-36__HIbgO","size42":"LinkButton_size-42__apHCj","size48":"LinkButton_size-48__7zgFe"};
|
|
433
|
+
|
|
434
|
+
function getIconClass(props) {
|
|
435
|
+
const classList = {
|
|
436
|
+
'has-left-icon': false,
|
|
437
|
+
'has-right-icon': false,
|
|
438
|
+
};
|
|
439
|
+
if (props.onClear) {
|
|
440
|
+
classList['has-right-icon'] = true;
|
|
441
|
+
}
|
|
442
|
+
if (props.isDropdown) {
|
|
443
|
+
classList[props.dropdownIconPosition === 'left' ? 'has-left-icon' : 'has-right-icon'] = true;
|
|
444
|
+
}
|
|
445
|
+
if (props.icon) {
|
|
446
|
+
classList[props.iconPosition !== 'right' ? 'has-left-icon' : 'has-right-icon'] = true;
|
|
447
|
+
}
|
|
448
|
+
return [classList['has-left-icon'] ? 'uui-has-left-icon' : 'uui-no-left-icon', classList['has-right-icon'] ? 'uui-has-right-icon' : 'uui-no-right-icon'];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const defaultSize$9 = '36';
|
|
452
|
+
function applyLinkButtonMods(mods) {
|
|
453
|
+
return [
|
|
454
|
+
css$12.root, css$12['size-' + (mods.size || defaultSize$9)], ...getIconClass(mods),
|
|
455
|
+
];
|
|
456
|
+
}
|
|
457
|
+
const LinkButton = withMods(Button$1, applyLinkButtonMods, (props) => ({
|
|
458
|
+
dropdownIcon: systemIcons[props.size || defaultSize$9].foldingArrow,
|
|
459
|
+
clearIcon: systemIcons[props.size || defaultSize$9].clear,
|
|
460
|
+
}));
|
|
461
|
+
|
|
462
|
+
var css$11 = {"typography-header":"TabButton_typography-header__RS80s","typography-block":"TabButton_typography-block__GaCpm","typography-inline":"TabButton_typography-inline__JMTQP","typography-16":"TabButton_typography-16__GLE4t","typography-14":"TabButton_typography-14__VWnXE","typography-12":"TabButton_typography-12__nGcxo","typography-promo":"TabButton_typography-promo__Des7p TabButton_typography-header__RS80s TabButton_typography-block__GaCpm TabButton_typography-inline__JMTQP","root":"TabButton_root__WwWmb","uui-notification":"TabButton_uui-notification__kS3SP","size-36":"TabButton_size-36__GqZ6d","size-48":"TabButton_size-48__SPXAO","size-60":"TabButton_size-60__lPhOn","typographyHeader":"TabButton_typography-header__RS80s","typographyBlock":"TabButton_typography-block__GaCpm","typographyInline":"TabButton_typography-inline__JMTQP","typography16":"TabButton_typography-16__GLE4t","typography14":"TabButton_typography-14__VWnXE","typography12":"TabButton_typography-12__nGcxo","typographyPromo":"TabButton_typography-promo__Des7p TabButton_typography-header__RS80s TabButton_typography-block__GaCpm TabButton_typography-inline__JMTQP","uuiNotification":"TabButton_uui-notification__kS3SP","size36":"TabButton_size-36__GqZ6d","size48":"TabButton_size-48__SPXAO","size60":"TabButton_size-60__lPhOn"};
|
|
463
|
+
|
|
464
|
+
function applyTabButtonMods(mods) {
|
|
465
|
+
return [
|
|
466
|
+
css$11.root, 'informer-color-default', css$11['size-' + (mods.size || '48')], mods.withNotify && css$11.uuiNotification, ...getIconClass(mods),
|
|
467
|
+
];
|
|
468
|
+
}
|
|
469
|
+
const TabButton = withMods(Button$1, applyTabButtonMods, (props) => (Object.assign(Object.assign({ dropdownIcon: systemIcons['36'].foldingArrow, clearIcon: systemIcons['36'].clear, countPosition: 'right' }, props), { rawProps: Object.assign({ role: 'tab' }, props.rawProps) })));
|
|
470
|
+
|
|
471
|
+
var css$10 = {"typography-header":"VerticalTabButton_typography-header__S9ICQ","typography-block":"VerticalTabButton_typography-block__CJa1q","typography-inline":"VerticalTabButton_typography-inline__evOKQ","typography-16":"VerticalTabButton_typography-16__DAHVj","typography-14":"VerticalTabButton_typography-14__XEpmf","typography-12":"VerticalTabButton_typography-12__db63C","typography-promo":"VerticalTabButton_typography-promo__LMvtV VerticalTabButton_typography-header__S9ICQ VerticalTabButton_typography-block__CJa1q VerticalTabButton_typography-inline__evOKQ","root":"VerticalTabButton_root__LInYW","typographyHeader":"VerticalTabButton_typography-header__S9ICQ","typographyBlock":"VerticalTabButton_typography-block__CJa1q","typographyInline":"VerticalTabButton_typography-inline__evOKQ","typography16":"VerticalTabButton_typography-16__DAHVj","typography14":"VerticalTabButton_typography-14__XEpmf","typography12":"VerticalTabButton_typography-12__db63C","typographyPromo":"VerticalTabButton_typography-promo__LMvtV VerticalTabButton_typography-header__S9ICQ VerticalTabButton_typography-block__CJa1q VerticalTabButton_typography-inline__evOKQ"};
|
|
472
|
+
|
|
473
|
+
function applyVerticalTabButtonMods() {
|
|
474
|
+
return [css$10.root];
|
|
475
|
+
}
|
|
476
|
+
const VerticalTabButton = withMods(TabButton, applyVerticalTabButtonMods);
|
|
477
|
+
|
|
478
|
+
const allButtonModes = [
|
|
479
|
+
'solid', 'outline', 'ghost', 'none',
|
|
480
|
+
];
|
|
481
|
+
const allFillStyles = allButtonModes;
|
|
482
|
+
const allSizes = [
|
|
483
|
+
'24', '30', '36', '42', '48',
|
|
484
|
+
];
|
|
485
|
+
const allRowSizes = [
|
|
486
|
+
null, '24', '30', '36', '42', '48',
|
|
487
|
+
];
|
|
488
|
+
const allSemanticColors = [
|
|
489
|
+
'info', 'success', 'warning', 'error',
|
|
490
|
+
];
|
|
491
|
+
const allButtonSemanticColors = [
|
|
492
|
+
'accent', 'primary', 'secondary', 'negative',
|
|
493
|
+
];
|
|
494
|
+
const allEpamBadgeSemanticColors = [
|
|
495
|
+
'info', 'success', 'warning', 'error', 'default',
|
|
496
|
+
];
|
|
497
|
+
const allTextSizes = [
|
|
498
|
+
'18', '24', '30', '36', '48',
|
|
499
|
+
];
|
|
500
|
+
const allFontStyles = [
|
|
501
|
+
'regular', 'semibold', 'italic', 'primary', 'promo',
|
|
502
|
+
];
|
|
503
|
+
var EditMode;
|
|
504
|
+
(function (EditMode) {
|
|
505
|
+
EditMode["FORM"] = "form";
|
|
506
|
+
EditMode["CELL"] = "cell";
|
|
507
|
+
EditMode["INLINE"] = "inline";
|
|
508
|
+
})(EditMode || (EditMode = {}));
|
|
509
|
+
|
|
510
|
+
var _path$J;
|
|
511
|
+
function _extends$M() { _extends$M = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$M.apply(this, arguments); }
|
|
512
|
+
var SvgCheck12 = function SvgCheck12(props, ref) {
|
|
513
|
+
return /*#__PURE__*/React.createElement("svg", _extends$M({
|
|
514
|
+
width: 12,
|
|
515
|
+
height: 12,
|
|
516
|
+
viewBox: "0 0 12 12",
|
|
517
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
518
|
+
ref: ref
|
|
519
|
+
}, props), _path$J || (_path$J = /*#__PURE__*/React.createElement("path", {
|
|
520
|
+
fillRule: "evenodd",
|
|
521
|
+
d: "M9.491 3.449 10.51 4.55 5.663 9.024 2.487 6.047l1.026-1.094L5.67 6.975z"
|
|
522
|
+
})));
|
|
523
|
+
};
|
|
524
|
+
var ForwardRef$M = /*#__PURE__*/forwardRef(SvgCheck12);
|
|
525
|
+
|
|
526
|
+
var _path$I;
|
|
527
|
+
function _extends$L() { _extends$L = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$L.apply(this, arguments); }
|
|
528
|
+
var SvgCheck18 = function SvgCheck18(props, ref) {
|
|
529
|
+
return /*#__PURE__*/React.createElement("svg", _extends$L({
|
|
530
|
+
width: 18,
|
|
531
|
+
height: 18,
|
|
532
|
+
viewBox: "0 0 18 18",
|
|
533
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
534
|
+
ref: ref
|
|
535
|
+
}, props), _path$I || (_path$I = /*#__PURE__*/React.createElement("path", {
|
|
536
|
+
fillRule: "evenodd",
|
|
537
|
+
d: "m14.247 4.341 1.506 1.318-7.704 8.804-4.756-4.756 1.414-1.414 3.244 3.243z"
|
|
538
|
+
})));
|
|
539
|
+
};
|
|
540
|
+
var ForwardRef$L = /*#__PURE__*/forwardRef(SvgCheck18);
|
|
541
|
+
|
|
542
|
+
var _path$H;
|
|
543
|
+
function _extends$K() { _extends$K = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$K.apply(this, arguments); }
|
|
544
|
+
var SvgPartlySelect12 = function SvgPartlySelect12(props, ref) {
|
|
545
|
+
return /*#__PURE__*/React.createElement("svg", _extends$K({
|
|
546
|
+
width: 12,
|
|
547
|
+
height: 12,
|
|
548
|
+
viewBox: "0 0 12 12",
|
|
549
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
550
|
+
ref: ref
|
|
551
|
+
}, props), _path$H || (_path$H = /*#__PURE__*/React.createElement("path", {
|
|
552
|
+
fillRule: "evenodd",
|
|
553
|
+
d: "M9 5v2H3V5z"
|
|
554
|
+
})));
|
|
555
|
+
};
|
|
556
|
+
var ForwardRef$K = /*#__PURE__*/forwardRef(SvgPartlySelect12);
|
|
557
|
+
|
|
558
|
+
var _path$G;
|
|
559
|
+
function _extends$J() { _extends$J = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$J.apply(this, arguments); }
|
|
560
|
+
var SvgPartlySelect18 = function SvgPartlySelect18(props, ref) {
|
|
561
|
+
return /*#__PURE__*/React.createElement("svg", _extends$J({
|
|
562
|
+
width: 18,
|
|
563
|
+
height: 18,
|
|
564
|
+
viewBox: "0 0 18 18",
|
|
565
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
566
|
+
ref: ref
|
|
567
|
+
}, props), _path$G || (_path$G = /*#__PURE__*/React.createElement("path", {
|
|
568
|
+
fillRule: "evenodd",
|
|
569
|
+
d: "M14 8v2H4V8z"
|
|
570
|
+
})));
|
|
571
|
+
};
|
|
572
|
+
var ForwardRef$J = /*#__PURE__*/forwardRef(SvgPartlySelect18);
|
|
573
|
+
|
|
574
|
+
var css$$ = {"typography-header":"Checkbox_typography-header__7PKo9","typography-block":"Checkbox_typography-block__9ZdZP","typography-inline":"Checkbox_typography-inline__v0o42","typography-16":"Checkbox_typography-16__QPhxK","typography-14":"Checkbox_typography-14__LuNUA","typography-12":"Checkbox_typography-12__UsWx3","typography-promo":"Checkbox_typography-promo__-nAeN Checkbox_typography-header__7PKo9 Checkbox_typography-block__9ZdZP Checkbox_typography-inline__v0o42","root":"Checkbox_root__-oMf6","size-18":"Checkbox_size-18__BzbEk","size-12":"Checkbox_size-12__ASr3R","mode-cell":"Checkbox_mode-cell__qVdJV","typographyHeader":"Checkbox_typography-header__7PKo9","typographyBlock":"Checkbox_typography-block__9ZdZP","typographyInline":"Checkbox_typography-inline__v0o42","typography16":"Checkbox_typography-16__QPhxK","typography14":"Checkbox_typography-14__LuNUA","typography12":"Checkbox_typography-12__UsWx3","typographyPromo":"Checkbox_typography-promo__-nAeN Checkbox_typography-header__7PKo9 Checkbox_typography-block__9ZdZP Checkbox_typography-inline__v0o42","size18":"Checkbox_size-18__BzbEk","size12":"Checkbox_size-12__ASr3R","modeCell":"Checkbox_mode-cell__qVdJV"};
|
|
575
|
+
|
|
576
|
+
function applyCheckboxMods(mods) {
|
|
577
|
+
return [
|
|
578
|
+
css$$.root, css$$['size-' + (mods.size || '18')], css$$['mode-' + (mods.mode || 'form')],
|
|
579
|
+
];
|
|
580
|
+
}
|
|
581
|
+
const applyUUICheckboxProps = (props) => ({
|
|
582
|
+
icon: props.size === '12' ? ForwardRef$M : ForwardRef$L,
|
|
583
|
+
indeterminateIcon: props.size === '12' ? ForwardRef$K : ForwardRef$J,
|
|
584
|
+
});
|
|
585
|
+
const Checkbox = withMods(Checkbox$1, applyCheckboxMods, applyUUICheckboxProps);
|
|
586
|
+
|
|
587
|
+
var css$_ = {"typography-header":"RadioInput_typography-header__TjrmU","typography-block":"RadioInput_typography-block__N9NNT","typography-inline":"RadioInput_typography-inline__9Q7fd","typography-16":"RadioInput_typography-16__MAISE","typography-14":"RadioInput_typography-14__dXuSH","typography-12":"RadioInput_typography-12__qFDEG","typography-promo":"RadioInput_typography-promo__w74S0 RadioInput_typography-header__TjrmU RadioInput_typography-block__N9NNT RadioInput_typography-inline__9Q7fd","root":"RadioInput_root__wxJgt","size-18":"RadioInput_size-18__csI3z","size-12":"RadioInput_size-12__2lBQH","typographyHeader":"RadioInput_typography-header__TjrmU","typographyBlock":"RadioInput_typography-block__N9NNT","typographyInline":"RadioInput_typography-inline__9Q7fd","typography16":"RadioInput_typography-16__MAISE","typography14":"RadioInput_typography-14__dXuSH","typography12":"RadioInput_typography-12__qFDEG","typographyPromo":"RadioInput_typography-promo__w74S0 RadioInput_typography-header__TjrmU RadioInput_typography-block__N9NNT RadioInput_typography-inline__9Q7fd","size18":"RadioInput_size-18__csI3z","size12":"RadioInput_size-12__2lBQH"};
|
|
588
|
+
|
|
589
|
+
var _circle;
|
|
590
|
+
function _extends$I() { _extends$I = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$I.apply(this, arguments); }
|
|
591
|
+
var SvgRadioPoint = function SvgRadioPoint(props, ref) {
|
|
592
|
+
return /*#__PURE__*/React.createElement("svg", _extends$I({
|
|
593
|
+
width: 18,
|
|
594
|
+
height: 18,
|
|
595
|
+
viewBox: "0 0 18 18",
|
|
596
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
597
|
+
ref: ref
|
|
598
|
+
}, props), _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
|
|
599
|
+
cx: 9,
|
|
600
|
+
cy: 9,
|
|
601
|
+
r: 6
|
|
602
|
+
})));
|
|
603
|
+
};
|
|
604
|
+
var ForwardRef$I = /*#__PURE__*/forwardRef(SvgRadioPoint);
|
|
605
|
+
|
|
606
|
+
function applyRadioInputMods(mods) {
|
|
607
|
+
return [css$_.root, css$_['size-' + (mods.size || '18')]];
|
|
608
|
+
}
|
|
609
|
+
const RadioInput = withMods(RadioInput$1, applyRadioInputMods, () => ({ icon: ForwardRef$I }));
|
|
610
|
+
|
|
611
|
+
var css$Z = {"root":"Switch_root__q-6Iy","size-12":"Switch_size-12__7-pqh","size-18":"Switch_size-18__l3E-E","size-24":"Switch_size-24__DmaSh","size12":"Switch_size-12__7-pqh","size18":"Switch_size-18__l3E-E","size24":"Switch_size-24__DmaSh"};
|
|
612
|
+
|
|
613
|
+
function applySwitchMods(mods) {
|
|
614
|
+
return [
|
|
615
|
+
'switch-vars', css$Z.root, css$Z['size-' + (mods.size || '18')],
|
|
616
|
+
];
|
|
617
|
+
}
|
|
618
|
+
const Switch = withMods(Switch$1, applySwitchMods);
|
|
619
|
+
|
|
620
|
+
/******************************************************************************
|
|
621
|
+
Copyright (c) Microsoft Corporation.
|
|
622
|
+
|
|
623
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
624
|
+
purpose with or without fee is hereby granted.
|
|
625
|
+
|
|
626
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
627
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
628
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
629
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
630
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
631
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
632
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
633
|
+
***************************************************************************** */
|
|
634
|
+
|
|
635
|
+
function __rest(s, e) {
|
|
636
|
+
var t = {};
|
|
637
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
638
|
+
t[p] = s[p];
|
|
639
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
640
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
641
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
642
|
+
t[p[i]] = s[p[i]];
|
|
643
|
+
}
|
|
644
|
+
return t;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
648
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
649
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
650
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
651
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
652
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
653
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
var textInputCss = {"typography-header":"TextInput_typography-header__D2R6e","typography-block":"TextInput_typography-block__tb5ac","typography-inline":"TextInput_typography-inline__DAwAE","typography-16":"TextInput_typography-16__FJ4fX","typography-14":"TextInput_typography-14__LgtNs","typography-12":"TextInput_typography-12__rCAko","typography-promo":"TextInput_typography-promo__uZQ6- TextInput_typography-header__D2R6e TextInput_typography-block__tb5ac TextInput_typography-inline__DAwAE","root":"TextInput_root__UKzkT","mode-form":"TextInput_mode-form__JsK1y","mode-inline":"TextInput_mode-inline__QkIod","mode-cell":"TextInput_mode-cell__H2C-f","size-24":"TextInput_size-24__buGZm","size-30":"TextInput_size-30__G0e43","size-36":"TextInput_size-36__bOehk","size-42":"TextInput_size-42__5Gdbv","size-48":"TextInput_size-48__Eb1Xy","typographyHeader":"TextInput_typography-header__D2R6e","typographyBlock":"TextInput_typography-block__tb5ac","typographyInline":"TextInput_typography-inline__DAwAE","typography16":"TextInput_typography-16__FJ4fX","typography14":"TextInput_typography-14__LgtNs","typography12":"TextInput_typography-12__rCAko","typographyPromo":"TextInput_typography-promo__uZQ6- TextInput_typography-header__D2R6e TextInput_typography-block__tb5ac TextInput_typography-inline__DAwAE","modeForm":"TextInput_mode-form__JsK1y","modeInline":"TextInput_mode-inline__QkIod","modeCell":"TextInput_mode-cell__H2C-f","size24":"TextInput_size-24__buGZm","size30":"TextInput_size-30__G0e43","size36":"TextInput_size-36__bOehk","size42":"TextInput_size-42__5Gdbv","size48":"TextInput_size-48__Eb1Xy"};
|
|
658
|
+
|
|
659
|
+
const defaultSize$8 = '36';
|
|
660
|
+
const defaultMode$4 = EditMode.FORM;
|
|
661
|
+
function applyTextInputMods(mods) {
|
|
662
|
+
return [
|
|
663
|
+
textInputCss.root,
|
|
664
|
+
textInputCss['size-' + (mods.size || defaultSize$8)],
|
|
665
|
+
textInputCss['mode-' + (mods.mode || defaultMode$4)],
|
|
666
|
+
];
|
|
667
|
+
}
|
|
668
|
+
const TextInput = withMods(TextInput$1, applyTextInputMods, (props) => ({
|
|
669
|
+
acceptIcon: systemIcons[props.size || defaultSize$8].accept,
|
|
670
|
+
cancelIcon: systemIcons[props.size || defaultSize$8].clear,
|
|
671
|
+
dropdownIcon: systemIcons[props.size || defaultSize$8].foldingArrow,
|
|
672
|
+
}));
|
|
673
|
+
const SearchInput = React__default.forwardRef((props, ref) => {
|
|
674
|
+
// analytics events are sending in IEditableDebouncer, so we need to avoid sending events in TextInput
|
|
675
|
+
const textInputProps = __rest(props, []);
|
|
676
|
+
delete textInputProps.getValueChangeAnalyticsEvent;
|
|
677
|
+
return (React__default.createElement(IEditableDebouncer, Object.assign({}, props, { render: (iEditable) => (React__default.createElement(TextInput, Object.assign({ icon: systemIcons[props.size || defaultSize$8].search, onCancel: !!props.value ? () => iEditable.onValueChange('') : undefined, type: "search", inputMode: "search", ref: ref }, textInputProps, iEditable))) })));
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
var css$Y = {"root":"Accordion_root__fTEyW","mode-block":"Accordion_mode-block__WJ0h9","mode-inline":"Accordion_mode-inline__2zs0-","padding-0":"Accordion_padding-0__GQG7C","padding-6":"Accordion_padding-6__0FFj5","padding-12":"Accordion_padding-12__Bl9rW","padding-18":"Accordion_padding-18__XQdL-","modeBlock":"Accordion_mode-block__WJ0h9","modeInline":"Accordion_mode-inline__2zs0-","padding0":"Accordion_padding-0__GQG7C","padding6":"Accordion_padding-6__0FFj5","padding12":"Accordion_padding-12__Bl9rW","padding18":"Accordion_padding-18__XQdL-"};
|
|
681
|
+
|
|
682
|
+
function applyAccordionMods(mods) {
|
|
683
|
+
return [
|
|
684
|
+
css$Y.root, css$Y['mode-' + (mods.mode || 'block')], mods.padding && css$Y['padding-' + mods.padding],
|
|
685
|
+
];
|
|
686
|
+
}
|
|
687
|
+
const Accordion = withMods(Accordion$1, applyAccordionMods, (mods) => ({
|
|
688
|
+
dropdownIcon: mods.dropdownIcon !== null && systemIcons[mods.mode === 'block' ? '60' : '30'].foldingArrow,
|
|
689
|
+
}));
|
|
690
|
+
|
|
691
|
+
var css$X = {"root":"ControlGroup_root__wOZ9-"};
|
|
692
|
+
|
|
693
|
+
const ControlGroup = withMods(ControlGroup$1, () => [css$X.root]);
|
|
694
|
+
|
|
695
|
+
var css$W = {"typography-header":"FlexRow_typography-header__2lsWG","typography-block":"FlexRow_typography-block__I0TO6","typography-inline":"FlexRow_typography-inline__br3BL","typography-16":"FlexRow_typography-16__ZDP4a","typography-14":"FlexRow_typography-14__fbJ6t","typography-12":"FlexRow_typography-12__xjb4B","typography-promo":"FlexRow_typography-promo__63NoR FlexRow_typography-header__2lsWG FlexRow_typography-block__I0TO6 FlexRow_typography-inline__br3BL","root":"FlexRow_root__8pevZ","border-bottom":"FlexRow_border-bottom__5L1Xk","top-shadow":"FlexRow_top-shadow__yLJfa","size-24":"FlexRow_size-24__UC-Ra","size-30":"FlexRow_size-30__KKsZ5","size-36":"FlexRow_size-36__oVCZp","size-42":"FlexRow_size-42__n5Pxh","size-48":"FlexRow_size-48__N-bVM","padding-6":"FlexRow_padding-6__TyXUB","padding-12":"FlexRow_padding-12__NiZVt","padding-18":"FlexRow_padding-18__f-DJ9","padding-24":"FlexRow_padding-24__aVQje","margin-24":"FlexRow_margin-24__W8cmr","margin-12":"FlexRow_margin-12__Tt04l","vPadding-12":"FlexRow_vPadding-12__f3sn6","vPadding-18":"FlexRow_vPadding-18__7Ljl4","vPadding-24":"FlexRow_vPadding-24__nJLBC","vPadding-36":"FlexRow_vPadding-36__7E6EY","vPadding-48":"FlexRow_vPadding-48__zzaPF","spacing-6":"FlexRow_spacing-6__l7a8O","spacing-12":"FlexRow_spacing-12__8ToPe","spacing-18":"FlexRow_spacing-18__QdC3L","typographyHeader":"FlexRow_typography-header__2lsWG","typographyBlock":"FlexRow_typography-block__I0TO6","typographyInline":"FlexRow_typography-inline__br3BL","typography16":"FlexRow_typography-16__ZDP4a","typography14":"FlexRow_typography-14__fbJ6t","typography12":"FlexRow_typography-12__xjb4B","typographyPromo":"FlexRow_typography-promo__63NoR FlexRow_typography-header__2lsWG FlexRow_typography-block__I0TO6 FlexRow_typography-inline__br3BL","borderBottom":"FlexRow_border-bottom__5L1Xk","topShadow":"FlexRow_top-shadow__yLJfa","size24":"FlexRow_size-24__UC-Ra","size30":"FlexRow_size-30__KKsZ5","size36":"FlexRow_size-36__oVCZp","size42":"FlexRow_size-42__n5Pxh","size48":"FlexRow_size-48__N-bVM","padding6":"FlexRow_padding-6__TyXUB","padding12":"FlexRow_padding-12__NiZVt","padding18":"FlexRow_padding-18__f-DJ9","padding24":"FlexRow_padding-24__aVQje","margin24":"FlexRow_margin-24__W8cmr","margin12":"FlexRow_margin-12__Tt04l","vPadding12":"FlexRow_vPadding-12__f3sn6","vPadding18":"FlexRow_vPadding-18__7Ljl4","vPadding24":"FlexRow_vPadding-24__nJLBC","vPadding36":"FlexRow_vPadding-36__7E6EY","vPadding48":"FlexRow_vPadding-48__zzaPF","spacing6":"FlexRow_spacing-6__l7a8O","spacing12":"FlexRow_spacing-12__8ToPe","spacing18":"FlexRow_spacing-18__QdC3L"};
|
|
696
|
+
|
|
697
|
+
const FlexCell = withMods(FlexCell$1, (props) => [css$W.flexCell]);
|
|
698
|
+
|
|
699
|
+
const FlexRow = withMods(FlexRow$1, (props) => {
|
|
700
|
+
return [
|
|
701
|
+
css$W.root, props.size !== null && css$W['size-' + (props.size || '36')], props.padding && css$W['padding-' + props.padding], props.vPadding && css$W['vPadding-' + props.vPadding], props.margin && css$W['margin-' + props.margin], props.topShadow && css$W.topShadow, props.borderBottom && css$W.borderBottom, props.spacing && css$W['spacing-' + props.spacing],
|
|
702
|
+
];
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
var css$V = {"root":"Panel_root__Ue9u5","margin-24":"Panel_margin-24__EZfwq","padding-12":"Panel_padding-12__zmnQV","padding-24":"Panel_padding-24__mOtka","shadow":"Panel_shadow__lMI9N","margin24":"Panel_margin-24__EZfwq","padding12":"Panel_padding-12__zmnQV","padding24":"Panel_padding-24__mOtka"};
|
|
706
|
+
|
|
707
|
+
const Panel = withMods(VPanel, (props) => [
|
|
708
|
+
'uui-panel', css$V.root, props.shadow && css$V.shadow, props.margin && css$V['margin-' + props.margin],
|
|
709
|
+
]);
|
|
710
|
+
|
|
711
|
+
var _path$F;
|
|
712
|
+
function _extends$H() { _extends$H = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$H.apply(this, arguments); }
|
|
713
|
+
var SvgNotificationCheckCircleFill24 = function SvgNotificationCheckCircleFill24(props, ref) {
|
|
714
|
+
return /*#__PURE__*/React.createElement("svg", _extends$H({
|
|
715
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
716
|
+
width: 24,
|
|
717
|
+
height: 24,
|
|
718
|
+
viewBox: "0 0 24 24",
|
|
719
|
+
ref: ref
|
|
720
|
+
}, props), _path$F || (_path$F = /*#__PURE__*/React.createElement("path", {
|
|
721
|
+
fillRule: "evenodd",
|
|
722
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
723
|
+
})));
|
|
724
|
+
};
|
|
725
|
+
var ForwardRef$H = /*#__PURE__*/forwardRef(SvgNotificationCheckCircleFill24);
|
|
726
|
+
|
|
727
|
+
var _path$E;
|
|
728
|
+
function _extends$G() { _extends$G = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$G.apply(this, arguments); }
|
|
729
|
+
var SvgNotificationWarningFill24 = function SvgNotificationWarningFill24(props, ref) {
|
|
730
|
+
return /*#__PURE__*/React.createElement("svg", _extends$G({
|
|
731
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
732
|
+
width: 24,
|
|
733
|
+
height: 24,
|
|
734
|
+
viewBox: "0 0 24 24",
|
|
735
|
+
ref: ref
|
|
736
|
+
}, props), _path$E || (_path$E = /*#__PURE__*/React.createElement("path", {
|
|
737
|
+
fillRule: "evenodd",
|
|
738
|
+
d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
|
|
739
|
+
})));
|
|
740
|
+
};
|
|
741
|
+
var ForwardRef$G = /*#__PURE__*/forwardRef(SvgNotificationWarningFill24);
|
|
742
|
+
|
|
743
|
+
var _path$D;
|
|
744
|
+
function _extends$F() { _extends$F = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$F.apply(this, arguments); }
|
|
745
|
+
var SvgNotificationErrorFill24 = function SvgNotificationErrorFill24(props, ref) {
|
|
746
|
+
return /*#__PURE__*/React.createElement("svg", _extends$F({
|
|
747
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
748
|
+
width: 24,
|
|
749
|
+
height: 24,
|
|
750
|
+
viewBox: "0 0 24 24",
|
|
751
|
+
ref: ref
|
|
752
|
+
}, props), _path$D || (_path$D = /*#__PURE__*/React.createElement("path", {
|
|
753
|
+
fillRule: "evenodd",
|
|
754
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
755
|
+
})));
|
|
756
|
+
};
|
|
757
|
+
var ForwardRef$F = /*#__PURE__*/forwardRef(SvgNotificationErrorFill24);
|
|
758
|
+
|
|
759
|
+
var _path$C;
|
|
760
|
+
function _extends$E() { _extends$E = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$E.apply(this, arguments); }
|
|
761
|
+
var SvgNotificationHelpFill24 = function SvgNotificationHelpFill24(props, ref) {
|
|
762
|
+
return /*#__PURE__*/React.createElement("svg", _extends$E({
|
|
763
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
764
|
+
width: 24,
|
|
765
|
+
height: 24,
|
|
766
|
+
viewBox: "0 0 24 24",
|
|
767
|
+
ref: ref
|
|
768
|
+
}, props), _path$C || (_path$C = /*#__PURE__*/React.createElement("path", {
|
|
769
|
+
fillRule: "evenodd",
|
|
770
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
|
|
771
|
+
})));
|
|
772
|
+
};
|
|
773
|
+
var ForwardRef$E = /*#__PURE__*/forwardRef(SvgNotificationHelpFill24);
|
|
774
|
+
|
|
775
|
+
var _path$B;
|
|
776
|
+
function _extends$D() { _extends$D = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$D.apply(this, arguments); }
|
|
777
|
+
var SvgNavigationClose24$1 = function SvgNavigationClose24(props, ref) {
|
|
778
|
+
return /*#__PURE__*/React.createElement("svg", _extends$D({
|
|
779
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
780
|
+
width: 24,
|
|
781
|
+
height: 24,
|
|
782
|
+
viewBox: "0 0 24 24",
|
|
783
|
+
ref: ref
|
|
784
|
+
}, props), _path$B || (_path$B = /*#__PURE__*/React.createElement("path", {
|
|
785
|
+
fillRule: "evenodd",
|
|
786
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
787
|
+
})));
|
|
788
|
+
};
|
|
789
|
+
var ForwardRef$D = /*#__PURE__*/forwardRef(SvgNavigationClose24$1);
|
|
790
|
+
|
|
791
|
+
var css$U = {"root":"Alert_root__o9-Bu","icon-wrapper":"Alert_icon-wrapper__MVBsA","alert-wrapper":"Alert_alert-wrapper__QuJWm","action-wrapper":"Alert_action-wrapper__-z2l9","action-icon":"Alert_action-icon__GhtYo","action-link":"Alert_action-link__Hj-D2","close-icon":"Alert_close-icon__brCPM","main-path":"Alert_main-path__jHhJZ","content":"Alert_content__ae2CO","iconWrapper":"Alert_icon-wrapper__MVBsA","alertWrapper":"Alert_alert-wrapper__QuJWm","actionWrapper":"Alert_action-wrapper__-z2l9","actionIcon":"Alert_action-icon__GhtYo","actionLink":"Alert_action-link__Hj-D2","closeIcon":"Alert_close-icon__brCPM","mainPath":"Alert_main-path__jHhJZ"};
|
|
792
|
+
|
|
793
|
+
const Alert = React.forwardRef((props, ref) => (React.createElement("div", Object.assign({ role: "alert", ref: ref, className: cx(css$U.alertWrapper, `alert-${props.color || 'default'}`, css$U.root, props.cx) }, props.rawProps),
|
|
794
|
+
React.createElement("div", { className: css$U.mainPath },
|
|
795
|
+
props.icon && (React.createElement("div", { className: css$U.iconWrapper },
|
|
796
|
+
React.createElement(IconContainer, { icon: props.icon, cx: css$U.actionIcon }))),
|
|
797
|
+
React.createElement("div", { className: css$U.content },
|
|
798
|
+
props.children,
|
|
799
|
+
props.actions && (React.createElement("div", { className: css$U.actionWrapper }, props.actions.map((action) => (React.createElement(LinkButton, { caption: action.name, onClick: action.action, key: action.name, cx: css$U.actionLink, size: "30" })))))),
|
|
800
|
+
props.onClose && React.createElement(IconButton, { icon: ForwardRef$D, color: "default", onClick: props.onClose, cx: css$U.closeIcon })))));
|
|
801
|
+
const WarningAlert = React.forwardRef((props, ref) => React.createElement(Alert, Object.assign({ icon: ForwardRef$G, color: "warning", ref: ref }, props)));
|
|
802
|
+
const SuccessAlert = React.forwardRef((props, ref) => React.createElement(Alert, Object.assign({ icon: ForwardRef$H, color: "success", ref: ref }, props)));
|
|
803
|
+
const HintAlert = React.forwardRef((props, ref) => React.createElement(Alert, Object.assign({ icon: ForwardRef$E, color: "info", ref: ref }, props)));
|
|
804
|
+
const ErrorAlert = React.forwardRef((props, ref) => React.createElement(Alert, Object.assign({ icon: ForwardRef$F, color: "error", ref: ref }, props)));
|
|
805
|
+
|
|
806
|
+
class Dropdown extends React.Component {
|
|
807
|
+
render() {
|
|
808
|
+
return React.createElement(Dropdown$1, Object.assign({}, this.props));
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
var css$T = {"root":"DropdownContainer_root__0tHS6"};
|
|
813
|
+
|
|
814
|
+
function applyDropdownContainerMods(mods) {
|
|
815
|
+
return [
|
|
816
|
+
css$T.root, mods.vPadding && `vPadding-${mods.vPadding}`, mods.padding && `padding-${mods.padding}`,
|
|
817
|
+
];
|
|
818
|
+
}
|
|
819
|
+
const DropdownContainer = withMods(DropdownContainer$1, applyDropdownContainerMods);
|
|
820
|
+
|
|
821
|
+
var css$S = {"typography-header":"DropdownMenu_typography-header__d5Gl6","typography-block":"DropdownMenu_typography-block__-l-b3","typography-inline":"DropdownMenu_typography-inline__QTz-3","typography-16":"DropdownMenu_typography-16__FrdMO","typography-14":"DropdownMenu_typography-14__cx4-6","typography-12":"DropdownMenu_typography-12__PDMu0","typography-promo":"DropdownMenu_typography-promo__-BGfx DropdownMenu_typography-header__d5Gl6 DropdownMenu_typography-block__-l-b3 DropdownMenu_typography-inline__QTz-3","menuRoot":"DropdownMenu_menuRoot__gRW4S","bodyRoot":"DropdownMenu_bodyRoot__hAgqI","submenuRootItem":"DropdownMenu_submenuRootItem__52Bxy","iconAfter":"DropdownMenu_iconAfter__Hbijr","iconCheck":"DropdownMenu_iconCheck__TtmI6","splitterRoot":"DropdownMenu_splitterRoot__mJGU2","splitter":"DropdownMenu_splitter__7AuFo","headerRoot":"DropdownMenu_headerRoot__iEVUM","itemRoot":"DropdownMenu_itemRoot__mBMPU","icon":"DropdownMenu_icon__YE2-L","link":"DropdownMenu_link__pgNjs","typographyHeader":"DropdownMenu_typography-header__d5Gl6","typographyBlock":"DropdownMenu_typography-block__-l-b3","typographyInline":"DropdownMenu_typography-inline__QTz-3","typography16":"DropdownMenu_typography-16__FrdMO","typography14":"DropdownMenu_typography-14__cx4-6","typography12":"DropdownMenu_typography-12__PDMu0","typographyPromo":"DropdownMenu_typography-promo__-BGfx DropdownMenu_typography-header__d5Gl6 DropdownMenu_typography-block__-l-b3 DropdownMenu_typography-inline__QTz-3"};
|
|
822
|
+
|
|
823
|
+
const icons = systemIcons['36'];
|
|
824
|
+
var IDropdownControlKeys;
|
|
825
|
+
(function (IDropdownControlKeys) {
|
|
826
|
+
IDropdownControlKeys["ENTER"] = "Enter";
|
|
827
|
+
IDropdownControlKeys["ESCAPE"] = "Escape";
|
|
828
|
+
IDropdownControlKeys["LEFT_ARROW"] = "ArrowLeft";
|
|
829
|
+
IDropdownControlKeys["RIGHT_ARROW"] = "ArrowRight";
|
|
830
|
+
IDropdownControlKeys["UP_ARROW"] = "ArrowUp";
|
|
831
|
+
IDropdownControlKeys["DOWN_ARROW"] = "ArrowDown";
|
|
832
|
+
})(IDropdownControlKeys || (IDropdownControlKeys = {}));
|
|
833
|
+
function DropdownMenuContainer(props) {
|
|
834
|
+
const menuRef = useRef(null);
|
|
835
|
+
const [currentlyFocused, setFocused] = useState(-1);
|
|
836
|
+
const menuItems = menuRef.current ? Array.from(menuRef.current.querySelectorAll(`[role="menuitem"]:not(.${uuiMod.disabled})`)) : [];
|
|
837
|
+
useEffect(() => {
|
|
838
|
+
var _a;
|
|
839
|
+
(_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
840
|
+
}, [menuRef.current]);
|
|
841
|
+
const changeFocus = (nextFocusedIndex) => {
|
|
842
|
+
if (menuItems.length > 0) {
|
|
843
|
+
setFocused(nextFocusedIndex);
|
|
844
|
+
menuItems[nextFocusedIndex].focus();
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
const handleArrowKeys = (e) => {
|
|
848
|
+
e.stopPropagation();
|
|
849
|
+
const lastMenuItemsIndex = menuItems.length - 1;
|
|
850
|
+
if (e.key === IDropdownControlKeys.UP_ARROW) {
|
|
851
|
+
changeFocus(currentlyFocused > 0 ? currentlyFocused - 1 : lastMenuItemsIndex);
|
|
852
|
+
}
|
|
853
|
+
else if (e.key === IDropdownControlKeys.DOWN_ARROW) {
|
|
854
|
+
changeFocus(currentlyFocused < lastMenuItemsIndex ? currentlyFocused + 1 : 0);
|
|
855
|
+
}
|
|
856
|
+
else if (e.key === props.closeOnKey && props.onClose) {
|
|
857
|
+
props.onClose();
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
return (React__default.createElement(FocusLock, { as: "menu", className: css$S.menuRoot, returnFocus: true, autoFocus: false, ref: menuRef, lockProps: { onKeyDown: handleArrowKeys, tabIndex: -1 } },
|
|
861
|
+
React__default.createElement(DropdownContainer$1, Object.assign({}, props, { rawProps: { tabIndex: -1 } }))));
|
|
862
|
+
}
|
|
863
|
+
const DropdownMenuBody = withMods(DropdownMenuContainer, () => [css$S.bodyRoot], ({ style }) => ({ style }));
|
|
864
|
+
const DropdownMenuButton = React__default.forwardRef((props, ref) => {
|
|
865
|
+
const context = useContext(UuiContext);
|
|
866
|
+
const { icon, iconPosition, onIconClick, caption, isDisabled, isSelected, isActive, link, href, onClick, toggleDropdownOpening, isDropdown, isOpen, target, } = props;
|
|
867
|
+
const handleClick = (event) => {
|
|
868
|
+
if (isDisabled || !onClick)
|
|
869
|
+
return;
|
|
870
|
+
onClick(event);
|
|
871
|
+
context.uuiAnalytics.sendEvent(props.clickAnalyticsEvent);
|
|
872
|
+
};
|
|
873
|
+
const handleOpenDropdown = (event) => {
|
|
874
|
+
if (event.key === IDropdownControlKeys.RIGHT_ARROW && isDropdown) {
|
|
875
|
+
toggleDropdownOpening(true);
|
|
876
|
+
}
|
|
877
|
+
else if (event.key === IDropdownControlKeys.ENTER && onClick) {
|
|
878
|
+
onClick(event);
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
const getMenuButtonContent = () => {
|
|
882
|
+
const isIconBefore = Boolean(icon && iconPosition !== 'right');
|
|
883
|
+
const isIconAfter = Boolean(icon && iconPosition === 'right');
|
|
884
|
+
const iconElement = (React__default.createElement(IconButton, { icon: icon, color: isActive ? 'info' : 'default', onClick: onIconClick, cx: cx$1(css$S.icon, iconPosition === 'right' ? css$S.iconAfter : css$S.iconBefore) }));
|
|
885
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
886
|
+
isIconBefore && iconElement,
|
|
887
|
+
React__default.createElement(Text$1, { cx: css$S.caption }, caption),
|
|
888
|
+
isIconAfter && (React__default.createElement(React__default.Fragment, null,
|
|
889
|
+
React__default.createElement(FlexSpacer, null),
|
|
890
|
+
iconElement))));
|
|
891
|
+
};
|
|
892
|
+
const isAnchor = Boolean(link || href);
|
|
893
|
+
const itemClassNames = cx$1(props.cx, css$S.itemRoot, isDisabled && uuiMod.disabled, isActive && uuiMod.active, isOpen && uuiMod.opened);
|
|
894
|
+
return isAnchor ? (React__default.createElement(Anchor$1, { cx: cx$1(css$S.link, itemClassNames), link: link, href: href, rawProps: { role: 'menuitem', tabIndex: isDisabled ? -1 : 0 }, onClick: handleClick, isDisabled: isDisabled, forwardedRef: ref, target: target }, getMenuButtonContent())) : (React__default.createElement(FlexRow$1, { rawProps: {
|
|
895
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
896
|
+
role: 'menuitem',
|
|
897
|
+
onKeyDown: isDisabled ? null : handleOpenDropdown,
|
|
898
|
+
}, cx: itemClassNames, onClick: handleClick, ref: ref },
|
|
899
|
+
getMenuButtonContent(),
|
|
900
|
+
isSelected && React__default.createElement(IconContainer, { icon: icons.accept, cx: css$S.selectedCheckmark })));
|
|
901
|
+
});
|
|
902
|
+
DropdownMenuButton.displayName = 'DropdownMenuButton';
|
|
903
|
+
function DropdownMenuSplitter(props) {
|
|
904
|
+
return (React__default.createElement("div", { className: cx$1(props.cx, css$S.splitterRoot) },
|
|
905
|
+
React__default.createElement("hr", { className: css$S.splitter })));
|
|
906
|
+
}
|
|
907
|
+
function DropdownMenuHeader(props) {
|
|
908
|
+
return (React__default.createElement("div", { className: cx$1(props.cx, css$S.headerRoot) },
|
|
909
|
+
React__default.createElement("span", { className: css$S.header }, props.caption)));
|
|
910
|
+
}
|
|
911
|
+
function DropdownSubMenu(props) {
|
|
912
|
+
return (React__default.createElement(Dropdown$1, { openOnHover: props.openOnHover || true, closeOnMouseLeave: "boundary", openDelay: 400, closeDelay: 400, placement: "right-start", renderBody: (dropdownProps) => React__default.createElement(DropdownMenuBody, Object.assign({ closeOnKey: IDropdownControlKeys.LEFT_ARROW }, props, dropdownProps)), renderTarget: (_a) => {
|
|
913
|
+
var { toggleDropdownOpening } = _a, targetProps = __rest(_a, ["toggleDropdownOpening"]);
|
|
914
|
+
return (React__default.createElement(DropdownMenuButton, Object.assign({ cx: cx$1(css$S.submenuRootItem), icon: icons.foldingArrow, iconPosition: "right", isDropdown: true, toggleDropdownOpening: toggleDropdownOpening }, props, targetProps)));
|
|
915
|
+
} }));
|
|
916
|
+
}
|
|
917
|
+
function DropdownMenuSwitchButton(props) {
|
|
918
|
+
const context = useContext(UuiContext);
|
|
919
|
+
const { icon, caption, isDisabled, isSelected, onValueChange, } = props;
|
|
920
|
+
const onHandleValueChange = (value) => {
|
|
921
|
+
if (isDisabled || !onValueChange)
|
|
922
|
+
return;
|
|
923
|
+
onValueChange(value);
|
|
924
|
+
context.uuiAnalytics.sendEvent(props.clickAnalyticsEvent);
|
|
925
|
+
};
|
|
926
|
+
const handleKeySelect = (e) => {
|
|
927
|
+
if (e.key === IDropdownControlKeys.ENTER) {
|
|
928
|
+
onHandleValueChange(!isSelected);
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
return (React__default.createElement(FlexRow$1, { cx: cx$1(props.cx, css$S.itemRoot, isDisabled && uuiMod.disabled), onClick: () => onHandleValueChange(!isSelected), rawProps: { role: 'menuitem', onKeyDown: handleKeySelect, tabIndex: isDisabled ? -1 : 0 } },
|
|
932
|
+
icon && React__default.createElement(IconContainer, { icon: icon, cx: css$S.iconBefore }),
|
|
933
|
+
React__default.createElement(Text$1, { cx: css$S.caption }, caption),
|
|
934
|
+
React__default.createElement(FlexSpacer, null),
|
|
935
|
+
React__default.createElement(Switch, { value: isSelected, tabIndex: -1, onValueChange: onHandleValueChange })));
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
var css$R = {"root":"Text_root__iUAW9"};
|
|
939
|
+
|
|
940
|
+
var css$Q = {"line-height-12":"text-layout_line-height-12__-fXrz","line-height-18":"text-layout_line-height-18__kfeYe","line-height-24":"text-layout_line-height-24__VmJFi","line-height-30":"text-layout_line-height-30__C4k89","font-size-10":"text-layout_font-size-10__U-DE-","font-size-12":"text-layout_font-size-12__1WdLm","font-size-14":"text-layout_font-size-14__5I7px","font-size-16":"text-layout_font-size-16__loUuU","font-size-18":"text-layout_font-size-18__PvhrF","font-size-24":"text-layout_font-size-24__JsYUV","v-padding-2":"text-layout_v-padding-2__-bGuG","v-padding-3":"text-layout_v-padding-3__ImU4D","v-padding-5":"text-layout_v-padding-5__el2DC","v-padding-6":"text-layout_v-padding-6__4QshS","v-padding-8":"text-layout_v-padding-8__CKQZ6","v-padding-9":"text-layout_v-padding-9__8cSJ-","v-padding-11":"text-layout_v-padding-11__kJwOK","v-padding-12":"text-layout_v-padding-12__J6PjS","v-padding-14":"text-layout_v-padding-14__TgJs7","v-padding-15":"text-layout_v-padding-15__kVl-D","v-padding-17":"text-layout_v-padding-17__065AA","v-padding-18":"text-layout_v-padding-18__hxDYP","v-padding-23":"text-layout_v-padding-23__44pE2","v-padding-24":"text-layout_v-padding-24__gxRAs","lineHeight12":"text-layout_line-height-12__-fXrz","lineHeight18":"text-layout_line-height-18__kfeYe","lineHeight24":"text-layout_line-height-24__VmJFi","lineHeight30":"text-layout_line-height-30__C4k89","fontSize10":"text-layout_font-size-10__U-DE-","fontSize12":"text-layout_font-size-12__1WdLm","fontSize14":"text-layout_font-size-14__5I7px","fontSize16":"text-layout_font-size-16__loUuU","fontSize18":"text-layout_font-size-18__PvhrF","fontSize24":"text-layout_font-size-24__JsYUV","vPadding2":"text-layout_v-padding-2__-bGuG","vPadding3":"text-layout_v-padding-3__ImU4D","vPadding5":"text-layout_v-padding-5__el2DC","vPadding6":"text-layout_v-padding-6__4QshS","vPadding8":"text-layout_v-padding-8__CKQZ6","vPadding9":"text-layout_v-padding-9__8cSJ-","vPadding11":"text-layout_v-padding-11__kJwOK","vPadding12":"text-layout_v-padding-12__J6PjS","vPadding14":"text-layout_v-padding-14__TgJs7","vPadding15":"text-layout_v-padding-15__kVl-D","vPadding17":"text-layout_v-padding-17__065AA","vPadding18":"text-layout_v-padding-18__hxDYP","vPadding23":"text-layout_v-padding-23__44pE2","vPadding24":"text-layout_v-padding-24__gxRAs"};
|
|
941
|
+
|
|
942
|
+
const defaultTextSettings = {
|
|
943
|
+
18: { lineHeight: 12, fontSize: 10 },
|
|
944
|
+
24: { lineHeight: 18, fontSize: 12 },
|
|
945
|
+
30: { lineHeight: 18, fontSize: 14 },
|
|
946
|
+
36: { lineHeight: 18, fontSize: 14 },
|
|
947
|
+
42: { lineHeight: 24, fontSize: 16 },
|
|
948
|
+
48: { lineHeight: 24, fontSize: 16 },
|
|
949
|
+
60: { lineHeight: 30, fontSize: 24 },
|
|
950
|
+
};
|
|
951
|
+
function getTextClasses(props, border) {
|
|
952
|
+
if (props.size === 'none') {
|
|
953
|
+
return [css$Q['line-height-' + props.lineHeight], css$Q['font-size-' + props.fontSize]];
|
|
954
|
+
}
|
|
955
|
+
const setting = {
|
|
956
|
+
size: props.size,
|
|
957
|
+
lineHeight: props.lineHeight || defaultTextSettings[props.size].lineHeight,
|
|
958
|
+
fontSize: props.fontSize || defaultTextSettings[props.size].fontSize,
|
|
959
|
+
};
|
|
960
|
+
const vPadding = (+setting.size - +setting.lineHeight - (border ? 2 : 0)) / 2;
|
|
961
|
+
return [
|
|
962
|
+
css$Q['line-height-' + setting.lineHeight], css$Q['font-size-' + setting.fontSize], css$Q['v-padding-' + vPadding],
|
|
963
|
+
];
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function applyTextMods(mods) {
|
|
967
|
+
const textClasses = getTextClasses({
|
|
968
|
+
size: mods.size || '36',
|
|
969
|
+
lineHeight: mods.lineHeight,
|
|
970
|
+
fontSize: mods.fontSize,
|
|
971
|
+
}, false);
|
|
972
|
+
return [
|
|
973
|
+
`uui-font-${mods.font || 'regular'}`, `uui-text-${mods.color || 'primary'}`, css$R.root,
|
|
974
|
+
].concat(textClasses);
|
|
975
|
+
}
|
|
976
|
+
const Text = withMods(Text$1, applyTextMods);
|
|
977
|
+
|
|
978
|
+
var css$P = {"container":"TextPlaceholder_container__Jn60D","loading-word":"TextPlaceholder_loading-word__22WpS","animated-loading":"TextPlaceholder_animated-loading__ao75r","skeleton_loading":"TextPlaceholder_skeleton_loading__NzV8h","loadingWord":"TextPlaceholder_loading-word__22WpS","animatedLoading":"TextPlaceholder_animated-loading__ao75r","skeletonLoading":"TextPlaceholder_skeleton_loading__NzV8h"};
|
|
979
|
+
|
|
980
|
+
const TextPlaceholder = (props) => {
|
|
981
|
+
const pattern = ' ';
|
|
982
|
+
const text = React.useMemo(() => {
|
|
983
|
+
const words = [];
|
|
984
|
+
for (let i = 0; i < (props.wordsCount || 1); i++) {
|
|
985
|
+
const lengthWord = Math.floor(Math.random() * 10 + 8);
|
|
986
|
+
words.push(pattern.repeat(lengthWord));
|
|
987
|
+
}
|
|
988
|
+
return words;
|
|
989
|
+
}, [props.wordsCount]);
|
|
990
|
+
return (React.createElement("div", Object.assign({ "aria-busy": true, className: css$P.container }, props.rawProps), text.map((it, index) => (React.createElement("span", { key: index, className: cx([
|
|
991
|
+
props.cx, css$P.loadingWord, !props.isNotAnimated && css$P.animatedLoading,
|
|
992
|
+
]), dangerouslySetInnerHTML: { __html: it } })))));
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
var style = {"typography-header":"typography_typography-header__xCe-Q","typography-block":"typography_typography-block__xvrwC","typography-inline":"typography_typography-inline__EbQN2","typography-16":"typography_typography-16__4OCWa","typography-14":"typography_typography-14__4Rcyl","typography-12":"typography_typography-12__2BEhy","typography-promo":"typography_typography-promo__P68Jv typography_typography-header__xCe-Q typography_typography-block__xvrwC typography_typography-inline__EbQN2","typographyHeader":"typography_typography-header__xCe-Q","typographyBlock":"typography_typography-block__xvrwC","typographyInline":"typography_typography-inline__EbQN2","typography16":"typography_typography-16__4OCWa","typography14":"typography_typography-14__4Rcyl","typography12":"typography_typography-12__2BEhy","typographyPromo":"typography_typography-promo__P68Jv typography_typography-header__xCe-Q typography_typography-block__xvrwC typography_typography-inline__EbQN2"};
|
|
996
|
+
|
|
997
|
+
const RichTextView = withMods(RichTextView$1, (mods) => [style.typographyPromo, style['typography-' + (mods.size || '14')]]);
|
|
998
|
+
|
|
999
|
+
var css$O = {"typography-header":"Modals_typography-header__Jwt-p","typography-block":"Modals_typography-block__szftG","typography-inline":"Modals_typography-inline__ZDBk-","typography-16":"Modals_typography-16__5x7rd","typography-14":"Modals_typography-14__ZF20L","typography-12":"Modals_typography-12__4fSpR","typography-promo":"Modals_typography-promo__JbRIA Modals_typography-header__Jwt-p Modals_typography-block__szftG Modals_typography-inline__ZDBk-","modal-blocker":"Modals_modal-blocker__nCAZ7","animateModalBlocker":"Modals_animateModalBlocker__S-4dL","modal":"Modals_modal__m41wI","modal-footer":"Modals_modal-footer__gg-90","border-top":"Modals_border-top__cfzhv","modal-header":"Modals_modal-header__8aswP","typographyHeader":"Modals_typography-header__Jwt-p","typographyBlock":"Modals_typography-block__szftG","typographyInline":"Modals_typography-inline__ZDBk-","typography16":"Modals_typography-16__5x7rd","typography14":"Modals_typography-14__ZF20L","typography12":"Modals_typography-12__4fSpR","typographyPromo":"Modals_typography-promo__JbRIA Modals_typography-header__Jwt-p Modals_typography-block__szftG Modals_typography-inline__ZDBk-","modalBlocker":"Modals_modal-blocker__nCAZ7","modalFooter":"Modals_modal-footer__gg-90","borderTop":"Modals_border-top__cfzhv","modalHeader":"Modals_modal-header__8aswP"};
|
|
1000
|
+
|
|
1001
|
+
const ModalBlocker = withMods(ModalBlocker$1, () => [css$O.modalBlocker]);
|
|
1002
|
+
const ModalWindow = withMods(ModalWindow$1, () => [css$O.modal], (props) => ({
|
|
1003
|
+
rawProps: {
|
|
1004
|
+
style: {
|
|
1005
|
+
width: `${props.width || 480}px`,
|
|
1006
|
+
height: props.height ? `${props.height}px` : 'auto',
|
|
1007
|
+
},
|
|
1008
|
+
},
|
|
1009
|
+
}));
|
|
1010
|
+
class ModalHeader extends React.Component {
|
|
1011
|
+
render() {
|
|
1012
|
+
return (React.createElement(FlexRow, { padding: this.props.padding || '24', vPadding: "12", borderBottom: this.props.borderBottom, cx: [css$O.modalHeader, this.props.cx], spacing: "12", rawProps: this.props.rawProps },
|
|
1013
|
+
this.props.title && (React.createElement(Text, { size: "48", fontSize: "18", font: "semibold" }, this.props.title)),
|
|
1014
|
+
this.props.children,
|
|
1015
|
+
this.props.onClose && React.createElement(FlexSpacer, null),
|
|
1016
|
+
this.props.onClose && (React.createElement(FlexCell, { shrink: 0, width: "auto" },
|
|
1017
|
+
React.createElement(IconButton, { icon: ForwardRef$D, onClick: this.props.onClose })))));
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
class ModalFooter extends React.Component {
|
|
1021
|
+
render() {
|
|
1022
|
+
return (React.createElement(FlexRow, { spacing: this.props.spacing || '12', cx: [
|
|
1023
|
+
css$O.modalFooter, this.props.borderTop && css$O.borderTop, this.props.cx,
|
|
1024
|
+
], padding: this.props.padding || '24', vPadding: this.props.vPadding || '24', rawProps: this.props.rawProps }, this.props.children));
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
const i18n = Object.assign(Object.assign({}, i18n$1), { dataPickerBody: {
|
|
1029
|
+
searchPlaceholder: 'Search',
|
|
1030
|
+
noRecordsMessage: 'No records found',
|
|
1031
|
+
noRecordsSubTitle: 'Check your spelling, or search for a different keyword',
|
|
1032
|
+
}, pickerModal: {
|
|
1033
|
+
headerTitle: 'Please select',
|
|
1034
|
+
searchPlaceholder: 'Type text for quick search',
|
|
1035
|
+
cancelButton: 'Cancel',
|
|
1036
|
+
selectButton: 'Select',
|
|
1037
|
+
clearAllButton: 'CLEAR ALL',
|
|
1038
|
+
selectAllButton: 'SELECT ALL',
|
|
1039
|
+
}, pickerInput: {
|
|
1040
|
+
showOnlySelectedLabel: 'Show only selected',
|
|
1041
|
+
clearSelectionButton: 'CLEAR ALL',
|
|
1042
|
+
clearSelectionButtonSingle: 'CLEAR',
|
|
1043
|
+
selectAllButton: 'SELECT ALL',
|
|
1044
|
+
}, notificationCard: {
|
|
1045
|
+
closeAllNotificationsButton: 'CLOSE ALL NOTIFICATIONS',
|
|
1046
|
+
}, form: {
|
|
1047
|
+
notifications: {
|
|
1048
|
+
actionButtonCaption: 'Restore',
|
|
1049
|
+
unsavedChangesMessage: 'You have unsaved changes. Click Restore button if you would like to recover the data',
|
|
1050
|
+
},
|
|
1051
|
+
modals: {
|
|
1052
|
+
beforeLeaveMessage: 'Your data may be lost. Do you want to save data?',
|
|
1053
|
+
discardButton: 'Discard',
|
|
1054
|
+
saveButton: 'Save',
|
|
1055
|
+
},
|
|
1056
|
+
}, rangeDatePicker: {
|
|
1057
|
+
pickerPlaceholderFrom: 'From:',
|
|
1058
|
+
pickerPlaceholderTo: 'To:',
|
|
1059
|
+
}, tables: {
|
|
1060
|
+
noResultsBlock: {
|
|
1061
|
+
title: 'No results found',
|
|
1062
|
+
message: 'We can’t find any item matching your request',
|
|
1063
|
+
},
|
|
1064
|
+
columnsConfigurationModal: {
|
|
1065
|
+
applyButton: 'Apply',
|
|
1066
|
+
cancelButton: 'Cancel',
|
|
1067
|
+
selectAllButton: 'Select all',
|
|
1068
|
+
clearAllButton: 'Clear all',
|
|
1069
|
+
checkAllButton: 'Check All',
|
|
1070
|
+
uncheckAllButton: 'Uncheck All',
|
|
1071
|
+
configureColumnsTitle: 'Configure columns',
|
|
1072
|
+
resetToDefaultButton: 'Reset to Default',
|
|
1073
|
+
displayedSectionTitle: 'Displayed in table',
|
|
1074
|
+
hiddenSectionTitle: 'Hidden in table',
|
|
1075
|
+
searchPlaceholder: 'Search by column name',
|
|
1076
|
+
noResultsFound: {
|
|
1077
|
+
text: 'No results found',
|
|
1078
|
+
subText: 'We can’t find any item matching your request',
|
|
1079
|
+
},
|
|
1080
|
+
enableAtLeastOneColumnMessage: 'Please enable at least one column',
|
|
1081
|
+
pinColumnButton: 'Pin column',
|
|
1082
|
+
unPinColumnButton: 'Unpin column',
|
|
1083
|
+
lockedColumnPinButton: 'You cannot unpin this column',
|
|
1084
|
+
},
|
|
1085
|
+
}, pickerFilterHeader: {
|
|
1086
|
+
sortAscending: 'Sort Ascending',
|
|
1087
|
+
sortDescending: 'Sort Descending',
|
|
1088
|
+
}, filterToolbar: {
|
|
1089
|
+
addCaption: 'Add filter',
|
|
1090
|
+
datePicker: {
|
|
1091
|
+
placeholder: 'Select date',
|
|
1092
|
+
removeCaption: 'REMOVE FILTER',
|
|
1093
|
+
clearCaption: 'CLEAR',
|
|
1094
|
+
},
|
|
1095
|
+
rangeDatePicker: {
|
|
1096
|
+
emptyPickerPlaceholder: 'Select period',
|
|
1097
|
+
emptyPlaceholderFrom: 'Select From',
|
|
1098
|
+
emptyPlaceholderTo: 'Select To',
|
|
1099
|
+
},
|
|
1100
|
+
pickerInput: {
|
|
1101
|
+
itemsPlaceholder: 'items',
|
|
1102
|
+
emptyValueCaption: 'ALL',
|
|
1103
|
+
},
|
|
1104
|
+
}, presetPanel: {
|
|
1105
|
+
addCaption: 'Add Preset',
|
|
1106
|
+
}, confirmationModal: {
|
|
1107
|
+
discardButton: 'Discard',
|
|
1108
|
+
saveButton: 'Save',
|
|
1109
|
+
} });
|
|
1110
|
+
|
|
1111
|
+
var _path$A;
|
|
1112
|
+
function _extends$C() { _extends$C = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$C.apply(this, arguments); }
|
|
1113
|
+
var SvgCross = function SvgCross(props, ref) {
|
|
1114
|
+
return /*#__PURE__*/React.createElement("svg", _extends$C({
|
|
1115
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1116
|
+
width: 24,
|
|
1117
|
+
height: 24,
|
|
1118
|
+
viewBox: "0 0 24 24",
|
|
1119
|
+
ref: ref
|
|
1120
|
+
}, props), _path$A || (_path$A = /*#__PURE__*/React.createElement("path", {
|
|
1121
|
+
fillRule: "evenodd",
|
|
1122
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
1123
|
+
})));
|
|
1124
|
+
};
|
|
1125
|
+
var ForwardRef$C = /*#__PURE__*/forwardRef(SvgCross);
|
|
1126
|
+
|
|
1127
|
+
var css$N = {"typography-header":"NotificationCard_typography-header__JcbKn","typography-block":"NotificationCard_typography-block__nKwA0","typography-inline":"NotificationCard_typography-inline__BO1HG","typography-16":"NotificationCard_typography-16__mixDm","typography-14":"NotificationCard_typography-14__E40GV","typography-12":"NotificationCard_typography-12__r-3ka","typography-promo":"NotificationCard_typography-promo__P5KSk NotificationCard_typography-header__JcbKn NotificationCard_typography-block__nKwA0 NotificationCard_typography-inline__BO1HG","root":"NotificationCard_root__HP4NM","icon-wrapper":"NotificationCard_icon-wrapper__FZUAl","action-wrapper":"NotificationCard_action-wrapper__MahuR","action-link":"NotificationCard_action-link__DXfp7","close-icon":"NotificationCard_close-icon__p0MvI","main-path":"NotificationCard_main-path__yWH2j","content":"NotificationCard_content__O4mCt","clear-button":"NotificationCard_clear-button__-RzMj","close-wrapper":"NotificationCard_close-wrapper__BVl8x","typographyHeader":"NotificationCard_typography-header__JcbKn","typographyBlock":"NotificationCard_typography-block__nKwA0","typographyInline":"NotificationCard_typography-inline__BO1HG","typography16":"NotificationCard_typography-16__mixDm","typography14":"NotificationCard_typography-14__E40GV","typography12":"NotificationCard_typography-12__r-3ka","typographyPromo":"NotificationCard_typography-promo__P5KSk NotificationCard_typography-header__JcbKn NotificationCard_typography-block__nKwA0 NotificationCard_typography-inline__BO1HG","iconWrapper":"NotificationCard_icon-wrapper__FZUAl","actionWrapper":"NotificationCard_action-wrapper__MahuR","actionLink":"NotificationCard_action-link__DXfp7","closeIcon":"NotificationCard_close-icon__p0MvI","mainPath":"NotificationCard_main-path__yWH2j","clearButton":"NotificationCard_clear-button__-RzMj","closeWrapper":"NotificationCard_close-wrapper__BVl8x"};
|
|
1128
|
+
|
|
1129
|
+
const NotificationCard = React__default.forwardRef((props, ref) => {
|
|
1130
|
+
const notificationCardNode = React__default.useRef(null);
|
|
1131
|
+
React__default.useImperativeHandle(ref, () => notificationCardNode.current, [notificationCardNode.current]);
|
|
1132
|
+
React__default.useLayoutEffect(() => {
|
|
1133
|
+
var _a, _b;
|
|
1134
|
+
(_a = notificationCardNode.current) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseenter', props.clearTimer);
|
|
1135
|
+
(_b = notificationCardNode.current) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseleave', props.refreshTimer);
|
|
1136
|
+
return () => {
|
|
1137
|
+
var _a, _b;
|
|
1138
|
+
(_a = notificationCardNode.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseenter', props.clearTimer);
|
|
1139
|
+
(_b = notificationCardNode.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseleave', props.refreshTimer);
|
|
1140
|
+
};
|
|
1141
|
+
}, []);
|
|
1142
|
+
return (React__default.createElement("div", Object.assign({ role: "alert", className: cx(props.color && `notification-card-${props.color}`, css$N.root, props.cx), ref: notificationCardNode }, props.rawProps),
|
|
1143
|
+
React__default.createElement("div", { className: css$N.mainPath },
|
|
1144
|
+
props.icon && (React__default.createElement("div", { className: css$N.iconWrapper },
|
|
1145
|
+
React__default.createElement(IconContainer, { icon: props.icon, cx: css$N.actionIcon }))),
|
|
1146
|
+
React__default.createElement("div", { className: css$N.content },
|
|
1147
|
+
props.children,
|
|
1148
|
+
props.actions && (React__default.createElement("div", { className: css$N.actionWrapper }, props.actions.map((action) => (React__default.createElement(LinkButton, { caption: action.name, onClick: action.action, key: action.name, cx: css$N.actionLink, size: "36", rawProps: action.rawProps })))))),
|
|
1149
|
+
props.onClose && (React__default.createElement("div", { className: css$N.closeWrapper },
|
|
1150
|
+
React__default.createElement(IconButton, { icon: ForwardRef$C, color: "default", onClick: props.onClose, cx: css$N.closeIcon }))))));
|
|
1151
|
+
});
|
|
1152
|
+
const WarningNotification = React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, Object.assign({ icon: ForwardRef$G, color: "warning" }, props, { ref: ref, cx: props.cx }))));
|
|
1153
|
+
const SuccessNotification = React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, Object.assign({ icon: ForwardRef$H, color: "success" }, props, { ref: ref, cx: props.cx }))));
|
|
1154
|
+
const HintNotification = React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, Object.assign({ icon: ForwardRef$E, color: "info" }, props, { ref: ref, cx: props.cx }))));
|
|
1155
|
+
const ErrorNotification = React__default.forwardRef((props, ref) => (React__default.createElement(NotificationCard, Object.assign({ icon: ForwardRef$F, color: "error" }, props, { ref: ref, cx: props.cx }))));
|
|
1156
|
+
class ClearNotification extends React__default.Component {
|
|
1157
|
+
render() {
|
|
1158
|
+
return (React__default.createElement("div", { className: cx(css$N.notificationWrapper, css$N.clearButton) },
|
|
1159
|
+
React__default.createElement(LinkButton, { caption: i18n.notificationCard.closeAllNotificationsButton, onClick: () => this.context.uuiNotifications.clearAll() })));
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
ClearNotification.contextType = UuiContext;
|
|
1163
|
+
|
|
1164
|
+
var css$M = {"root":"Tooltip_root__zZwnu"};
|
|
1165
|
+
|
|
1166
|
+
function applyTooltipMods(mods) {
|
|
1167
|
+
return [
|
|
1168
|
+
`tooltip-${mods.color}`,
|
|
1169
|
+
css$M.root,
|
|
1170
|
+
];
|
|
1171
|
+
}
|
|
1172
|
+
const Tooltip = withMods(Tooltip$1, applyTooltipMods);
|
|
1173
|
+
|
|
1174
|
+
class ConfirmationModal extends React.Component {
|
|
1175
|
+
render() {
|
|
1176
|
+
let bodyContent;
|
|
1177
|
+
if (this.props.bodyContent) {
|
|
1178
|
+
bodyContent = React.createElement(Panel, { margin: "24" }, this.props.bodyContent);
|
|
1179
|
+
}
|
|
1180
|
+
return (React.createElement(ModalBlocker, Object.assign({}, this.props),
|
|
1181
|
+
React.createElement(ModalWindow, { width: 420 },
|
|
1182
|
+
React.createElement(ModalHeader, { borderBottom: true, title: this.props.caption, onClose: () => this.props.abort() }),
|
|
1183
|
+
React.createElement(ScrollBars, null, bodyContent),
|
|
1184
|
+
React.createElement(ModalFooter, null,
|
|
1185
|
+
React.createElement(FlexSpacer, null),
|
|
1186
|
+
this.props.hideCancelButton || (React.createElement(Button, { caption: i18n.form.modals.discardButton, onClick: () => this.props.success(false), mode: "outline", color: "secondary" })),
|
|
1187
|
+
React.createElement(Button, { caption: i18n.form.modals.saveButton, onClick: () => this.props.success(true), color: "accent" })))));
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
var css$L = {"typography-header":"LabeledInput_typography-header__HJu91","typography-block":"LabeledInput_typography-block__4Jo8P","typography-inline":"LabeledInput_typography-inline__iNLix","typography-16":"LabeledInput_typography-16__B-aku","typography-14":"LabeledInput_typography-14__YxFLH","typography-12":"LabeledInput_typography-12__Jr6Uq","typography-promo":"LabeledInput_typography-promo__3-e-V LabeledInput_typography-header__HJu91 LabeledInput_typography-block__4Jo8P LabeledInput_typography-inline__iNLix","root":"LabeledInput_root__xDC2q","size-24":"LabeledInput_size-24__0LWBQ","size-30":"LabeledInput_size-30__KDnLe","size-36":"LabeledInput_size-36__4qHf7","size-42":"LabeledInput_size-42__zo6a7","size-48":"LabeledInput_size-48__3NqJt","typographyHeader":"LabeledInput_typography-header__HJu91","typographyBlock":"LabeledInput_typography-block__4Jo8P","typographyInline":"LabeledInput_typography-inline__iNLix","typography16":"LabeledInput_typography-16__B-aku","typography14":"LabeledInput_typography-14__YxFLH","typography12":"LabeledInput_typography-12__Jr6Uq","typographyPromo":"LabeledInput_typography-promo__3-e-V LabeledInput_typography-header__HJu91 LabeledInput_typography-block__4Jo8P LabeledInput_typography-inline__iNLix","size24":"LabeledInput_size-24__0LWBQ","size30":"LabeledInput_size-30__KDnLe","size36":"LabeledInput_size-36__4qHf7","size42":"LabeledInput_size-42__zo6a7","size48":"LabeledInput_size-48__3NqJt"};
|
|
1192
|
+
|
|
1193
|
+
const defaultSize$7 = '36';
|
|
1194
|
+
function applyLabeledInputMods(mods) {
|
|
1195
|
+
return [css$L.root, css$L['size-' + (mods.size || defaultSize$7)]];
|
|
1196
|
+
}
|
|
1197
|
+
const LabeledInput = withMods(LabeledInput$1, applyLabeledInputMods, (props) => ({
|
|
1198
|
+
Tooltip,
|
|
1199
|
+
infoIcon: systemIcons[props.size || defaultSize$7].help,
|
|
1200
|
+
}));
|
|
1201
|
+
|
|
1202
|
+
var css$K = {"root":"RadioGroup_root__uLWIn"};
|
|
1203
|
+
|
|
1204
|
+
const RadioGroup = withMods(RadioGroup$1, () => [css$K.root], () => ({ RadioInput }));
|
|
1205
|
+
|
|
1206
|
+
function applyScrollBarsMods() {
|
|
1207
|
+
return [
|
|
1208
|
+
'uui-scroll-bars', 'uui-shadow-top', 'uui-shadow-bottom',
|
|
1209
|
+
];
|
|
1210
|
+
}
|
|
1211
|
+
const ScrollBars = withMods(ScrollBars$1, applyScrollBarsMods);
|
|
1212
|
+
|
|
1213
|
+
const VirtualList = VirtualList$1;
|
|
1214
|
+
|
|
1215
|
+
var css$J = {"root":"Blocker_root__OB584"};
|
|
1216
|
+
|
|
1217
|
+
var css$I = {"root":"Spinner_root__jJ3FR","uui-spinner":"Spinner_uui-spinner__qD4cq","uuiSpinner":"Spinner_uui-spinner__qD4cq"};
|
|
1218
|
+
|
|
1219
|
+
function applySpinnerMods() {
|
|
1220
|
+
return [css$I.root];
|
|
1221
|
+
}
|
|
1222
|
+
const Spinner = withMods(Spinner$1, applySpinnerMods);
|
|
1223
|
+
|
|
1224
|
+
const Blocker = withMods(Blocker$1, () => [css$J.root], (cmpProps) => ({ renderSpinner: cmpProps.renderSpinner || (() => React__default.createElement(Spinner, null)) }));
|
|
1225
|
+
|
|
1226
|
+
var css$H = {"root":"CheckboxGroup_root__6KmvL"};
|
|
1227
|
+
|
|
1228
|
+
const CheckboxGroup = withMods(CheckboxGroup$1, () => [css$H.root], () => ({ CheckboxInput: Checkbox }));
|
|
1229
|
+
|
|
1230
|
+
function MultiSwitchComponent(props, ref) {
|
|
1231
|
+
return (React.createElement(ControlGroup, { ref: ref, rawProps: Object.assign(Object.assign({}, props.rawProps), { role: 'tablist' }) }, props.items.map((item, index) => (React.createElement(Button, Object.assign({}, props, item, { isDisabled: props.isDisabled, key: index + '-' + item.id, onClick: () => props.onValueChange(item.id), mode: props.value === item.id ? 'solid' : 'outline', color: props.color === 'secondary' && props.value === item.id ? 'primary' : props.color || 'primary', size: props.size, rawProps: { 'aria-current': props.value === item.id, role: 'tab' } }))))));
|
|
1232
|
+
}
|
|
1233
|
+
const MultiSwitch = React.forwardRef(MultiSwitchComponent);
|
|
1234
|
+
|
|
1235
|
+
var css$G = {"typography-header":"NumericInput_typography-header__GGZXK","typography-block":"NumericInput_typography-block__kzaEI","typography-inline":"NumericInput_typography-inline__i-mmY","typography-16":"NumericInput_typography-16__1kNP6","typography-14":"NumericInput_typography-14__GS-GA","typography-12":"NumericInput_typography-12__-r6Ni","typography-promo":"NumericInput_typography-promo__7QcU- NumericInput_typography-header__GGZXK NumericInput_typography-block__kzaEI NumericInput_typography-inline__i-mmY","root":"NumericInput_root__vElno","size-24":"NumericInput_size-24__9pSyj","size-30":"NumericInput_size-30__kfXj0","size-36":"NumericInput_size-36__tYgRe","size-42":"NumericInput_size-42__RoV0p","size-48":"NumericInput_size-48__wyaYa","mode-form":"NumericInput_mode-form__2EKWT","mode-cell":"NumericInput_mode-cell__oJI4L","typographyHeader":"NumericInput_typography-header__GGZXK","typographyBlock":"NumericInput_typography-block__kzaEI","typographyInline":"NumericInput_typography-inline__i-mmY","typography16":"NumericInput_typography-16__1kNP6","typography14":"NumericInput_typography-14__GS-GA","typography12":"NumericInput_typography-12__-r6Ni","typographyPromo":"NumericInput_typography-promo__7QcU- NumericInput_typography-header__GGZXK NumericInput_typography-block__kzaEI NumericInput_typography-inline__i-mmY","size24":"NumericInput_size-24__9pSyj","size30":"NumericInput_size-30__kfXj0","size36":"NumericInput_size-36__tYgRe","size42":"NumericInput_size-42__RoV0p","size48":"NumericInput_size-48__wyaYa","modeForm":"NumericInput_mode-form__2EKWT","modeCell":"NumericInput_mode-cell__oJI4L"};
|
|
1236
|
+
|
|
1237
|
+
const defaultSize$6 = '36';
|
|
1238
|
+
const defaultMode$3 = EditMode.FORM;
|
|
1239
|
+
function applyNumericInputMods(mods) {
|
|
1240
|
+
return [
|
|
1241
|
+
textInputCss.root, css$G.root, css$G['size-' + (mods.size || defaultSize$6)], textInputCss['size-' + (mods.size || defaultSize$6)], textInputCss['mode-' + (mods.mode || defaultMode$3)],
|
|
1242
|
+
];
|
|
1243
|
+
}
|
|
1244
|
+
const NumericInput = withMods(NumericInput$1, applyNumericInputMods, (props) => {
|
|
1245
|
+
var _a, _b;
|
|
1246
|
+
return ({
|
|
1247
|
+
upIcon: systemIcons[props.size || defaultSize$6].foldingArrow,
|
|
1248
|
+
downIcon: systemIcons[props.size || defaultSize$6].foldingArrow,
|
|
1249
|
+
align: (_a = props.align) !== null && _a !== void 0 ? _a : (props.mode === 'cell' ? 'right' : 'left'),
|
|
1250
|
+
disableArrows: (_b = props.disableArrows) !== null && _b !== void 0 ? _b : props.mode === 'cell',
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
var css$F = {"typography-header":"TextArea_typography-header__o-1aw","typography-block":"TextArea_typography-block__eszLT","typography-inline":"TextArea_typography-inline__Y5s6o","typography-16":"TextArea_typography-16__FZZaw","typography-14":"TextArea_typography-14__ZQ-8z","typography-12":"TextArea_typography-12__iYiOG","typography-promo":"TextArea_typography-promo__pYQ5f TextArea_typography-header__o-1aw TextArea_typography-block__eszLT TextArea_typography-inline__Y5s6o","root":"TextArea_root__rb0Et","mode-form":"TextArea_mode-form__1DZlL","mode-cell":"TextArea_mode-cell__KthXC","mode-inline":"TextArea_mode-inline__dZEPS","size-24":"TextArea_size-24__-1cgl","size-30":"TextArea_size-30__B2Zjq","size-36":"TextArea_size-36__r2jj6","size-42":"TextArea_size-42__G6PPY","size-48":"TextArea_size-48__1yQdt","typographyHeader":"TextArea_typography-header__o-1aw","typographyBlock":"TextArea_typography-block__eszLT","typographyInline":"TextArea_typography-inline__Y5s6o","typography16":"TextArea_typography-16__FZZaw","typography14":"TextArea_typography-14__ZQ-8z","typography12":"TextArea_typography-12__iYiOG","typographyPromo":"TextArea_typography-promo__pYQ5f TextArea_typography-header__o-1aw TextArea_typography-block__eszLT TextArea_typography-inline__Y5s6o","modeForm":"TextArea_mode-form__1DZlL","modeCell":"TextArea_mode-cell__KthXC","modeInline":"TextArea_mode-inline__dZEPS","size24":"TextArea_size-24__-1cgl","size30":"TextArea_size-30__B2Zjq","size36":"TextArea_size-36__r2jj6","size42":"TextArea_size-42__G6PPY","size48":"TextArea_size-48__1yQdt"};
|
|
1255
|
+
|
|
1256
|
+
const defaultSize$5 = '36';
|
|
1257
|
+
const defaultMode$2 = EditMode.FORM;
|
|
1258
|
+
function applyTextAreaMods(mods) {
|
|
1259
|
+
return [
|
|
1260
|
+
css$F.root, css$F['size-' + (mods.size || defaultSize$5)], css$F['mode-' + (mods.mode || defaultMode$2)],
|
|
1261
|
+
];
|
|
1262
|
+
}
|
|
1263
|
+
const TextArea = withMods(TextArea$1, applyTextAreaMods, (props) => ({
|
|
1264
|
+
autoSize: props.mode === EditMode.CELL ? true : props.autoSize,
|
|
1265
|
+
maxLength: props.mode === EditMode.CELL ? undefined : props.maxLength,
|
|
1266
|
+
}));
|
|
1267
|
+
|
|
1268
|
+
var css$E = {"typography-header":"DatePicker_typography-header__d3UN6","typography-block":"DatePicker_typography-block__vnQqM","typography-inline":"DatePicker_typography-inline__uM5kg","typography-16":"DatePicker_typography-16__-wmeU","typography-14":"DatePicker_typography-14__Upcdm","typography-12":"DatePicker_typography-12__Z1YnJ","typography-promo":"DatePicker_typography-promo__V5CNx DatePicker_typography-header__d3UN6 DatePicker_typography-block__vnQqM DatePicker_typography-inline__uM5kg","root":"DatePicker_root__kqFyh","typographyHeader":"DatePicker_typography-header__d3UN6","typographyBlock":"DatePicker_typography-block__vnQqM","typographyInline":"DatePicker_typography-inline__uM5kg","typography16":"DatePicker_typography-16__-wmeU","typography14":"DatePicker_typography-14__Upcdm","typography12":"DatePicker_typography-12__Z1YnJ","typographyPromo":"DatePicker_typography-promo__V5CNx DatePicker_typography-header__d3UN6 DatePicker_typography-block__vnQqM DatePicker_typography-inline__uM5kg"};
|
|
1269
|
+
|
|
1270
|
+
var calendarCss = {"typography-header":"Calendar_typography-header__dkLL8","typography-block":"Calendar_typography-block__DXJIH","typography-inline":"Calendar_typography-inline__NGFRU","typography-16":"Calendar_typography-16__FGS6a","typography-14":"Calendar_typography-14__fa4gQ","typography-12":"Calendar_typography-12__8rwED","typography-promo":"Calendar_typography-promo__-3dg- Calendar_typography-header__dkLL8 Calendar_typography-block__DXJIH Calendar_typography-inline__NGFRU","root":"Calendar_root__Vh71D","typographyHeader":"Calendar_typography-header__dkLL8","typographyBlock":"Calendar_typography-block__DXJIH","typographyInline":"Calendar_typography-inline__NGFRU","typography16":"Calendar_typography-16__FGS6a","typography14":"Calendar_typography-14__fa4gQ","typography12":"Calendar_typography-12__8rwED","typographyPromo":"Calendar_typography-promo__-3dg- Calendar_typography-header__dkLL8 Calendar_typography-block__DXJIH Calendar_typography-inline__NGFRU"};
|
|
1271
|
+
|
|
1272
|
+
function applyDatePickerBodyMods() {
|
|
1273
|
+
return [css$E.root, calendarCss.root];
|
|
1274
|
+
}
|
|
1275
|
+
const DatePickerBody = withMods(DatePickerBody$1, applyDatePickerBodyMods, () => ({ navIconLeft: ForwardRef$10, navIconRight: ForwardRef$10 }));
|
|
1276
|
+
|
|
1277
|
+
const defaultMode$1 = EditMode.FORM;
|
|
1278
|
+
class DatePicker extends BaseDatePicker {
|
|
1279
|
+
constructor() {
|
|
1280
|
+
super(...arguments);
|
|
1281
|
+
this.renderInput = (props) => {
|
|
1282
|
+
var _a;
|
|
1283
|
+
return (React__default.createElement(TextInput, Object.assign({}, props, { onClick: null, isDropdown: false, cx: cx$1(this.props.inputCx, this.state.isOpen && uuiMod.focus), icon: this.props.mode !== EditMode.CELL && systemIcons[this.props.size || '36'].calendar, iconPosition: this.props.iconPosition || 'left', placeholder: this.props.placeholder ? this.props.placeholder : this.getFormat(), size: this.props.size || '36', value: this.state.inputValue, onValueChange: this.handleInputChange, onCancel: this.props.disableClear || !this.state.inputValue ? undefined : this.handleCancel, isInvalid: this.props.isInvalid, isDisabled: this.props.isDisabled, isReadonly: this.props.isReadonly, tabIndex: this.props.isReadonly || this.props.isDisabled ? -1 : 0, onFocus: this.handleFocus, onBlur: this.handleBlur, mode: this.props.mode || defaultMode$1, rawProps: (_a = this.props.rawProps) === null || _a === void 0 ? void 0 : _a.input })));
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
renderBody(props) {
|
|
1287
|
+
var _a, _b, _c;
|
|
1288
|
+
return (React__default.createElement(DropdownContainer, Object.assign({}, props),
|
|
1289
|
+
React__default.createElement(DatePickerBody, { cx: cx$1(this.props.bodyCx), filter: this.props.filter, value: this.getValue(), setSelectedDate: this.setSelectedDate, setDisplayedDateAndView: this.setDisplayedDateAndView, changeIsOpen: this.onToggle, renderDay: this.props.renderDay, isHoliday: this.props.isHoliday, rawProps: (_a = this.props.rawProps) === null || _a === void 0 ? void 0 : _a.body }), (_c = (_b = this.props).renderFooter) === null || _c === void 0 ? void 0 :
|
|
1290
|
+
_c.call(_b)));
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
function applyDateSelectionMods() {
|
|
1295
|
+
return [calendarCss.root];
|
|
1296
|
+
}
|
|
1297
|
+
const Calendar = withMods(Calendar$1, applyDateSelectionMods);
|
|
1298
|
+
|
|
1299
|
+
var rangeCss = {"typography-header":"RangeDatePickerBody_typography-header__yuzZD","typography-block":"RangeDatePickerBody_typography-block__lYgPa","typography-inline":"RangeDatePickerBody_typography-inline__E8RNG","typography-16":"RangeDatePickerBody_typography-16__9uEL3","typography-14":"RangeDatePickerBody_typography-14__TEa5n","typography-12":"RangeDatePickerBody_typography-12__S-NBX","typography-promo":"RangeDatePickerBody_typography-promo__4VksA RangeDatePickerBody_typography-header__yuzZD RangeDatePickerBody_typography-block__lYgPa RangeDatePickerBody_typography-inline__E8RNG","root":"RangeDatePickerBody_root__CCVfb","typographyHeader":"RangeDatePickerBody_typography-header__yuzZD","typographyBlock":"RangeDatePickerBody_typography-block__lYgPa","typographyInline":"RangeDatePickerBody_typography-inline__E8RNG","typography16":"RangeDatePickerBody_typography-16__9uEL3","typography14":"RangeDatePickerBody_typography-14__TEa5n","typography12":"RangeDatePickerBody_typography-12__S-NBX","typographyPromo":"RangeDatePickerBody_typography-promo__4VksA RangeDatePickerBody_typography-header__yuzZD RangeDatePickerBody_typography-block__lYgPa RangeDatePickerBody_typography-inline__E8RNG"};
|
|
1300
|
+
|
|
1301
|
+
var calendarPresetsCss = {"typography-header":"CalendarPresets_typography-header__D2UZW","typography-block":"CalendarPresets_typography-block__68m9o","typography-inline":"CalendarPresets_typography-inline__5mzPE","typography-16":"CalendarPresets_typography-16__-TrF-","typography-14":"CalendarPresets_typography-14__-onzo","typography-12":"CalendarPresets_typography-12__zE74w","typography-promo":"CalendarPresets_typography-promo__Zp05u CalendarPresets_typography-header__D2UZW CalendarPresets_typography-block__68m9o CalendarPresets_typography-inline__5mzPE","root":"CalendarPresets_root__5O668","typographyHeader":"CalendarPresets_typography-header__D2UZW","typographyBlock":"CalendarPresets_typography-block__68m9o","typographyInline":"CalendarPresets_typography-inline__5mzPE","typography16":"CalendarPresets_typography-16__-TrF-","typography14":"CalendarPresets_typography-14__-onzo","typography12":"CalendarPresets_typography-12__zE74w","typographyPromo":"CalendarPresets_typography-promo__Zp05u CalendarPresets_typography-header__D2UZW CalendarPresets_typography-block__68m9o CalendarPresets_typography-inline__5mzPE"};
|
|
1302
|
+
|
|
1303
|
+
function applyRangeDatePickerBodyMods() {
|
|
1304
|
+
return [
|
|
1305
|
+
css$E.root, rangeCss.root, calendarCss.root, calendarPresetsCss.root,
|
|
1306
|
+
];
|
|
1307
|
+
}
|
|
1308
|
+
const RangeDatePickerBody = withMods(RangeDatePickerBody$1, applyRangeDatePickerBodyMods, () => ({
|
|
1309
|
+
navIconLeft: ForwardRef$10,
|
|
1310
|
+
navIconRight: ForwardRef$10,
|
|
1311
|
+
}));
|
|
1312
|
+
|
|
1313
|
+
var css$D = {"typography-header":"RangeDatePicker_typography-header__1MSa3","typography-block":"RangeDatePicker_typography-block__pC0T7","typography-inline":"RangeDatePicker_typography-inline__efdyU","typography-16":"RangeDatePicker_typography-16__FHiRR","typography-14":"RangeDatePicker_typography-14__5MCXV","typography-12":"RangeDatePicker_typography-12__zcQS2","typography-promo":"RangeDatePicker_typography-promo__GtLFC RangeDatePicker_typography-header__1MSa3 RangeDatePicker_typography-block__pC0T7 RangeDatePicker_typography-inline__efdyU","dropdown-container":"RangeDatePicker_dropdown-container__GJh6o","container":"RangeDatePicker_container__Kz2FS","button-group":"RangeDatePicker_button-group__a-twv","date-input":"RangeDatePicker_date-input__2aXJj","size-24":"RangeDatePicker_size-24__64v-x","size-30":"RangeDatePicker_size-30__7OPWW","size-36":"RangeDatePicker_size-36__urHhS","size-42":"RangeDatePicker_size-42__VMCut","size-48":"RangeDatePicker_size-48__YHcLe","date-input-group":"RangeDatePicker_date-input-group__CGdCd","separator":"RangeDatePicker_separator__qmCk8","mode-form":"RangeDatePicker_mode-form__o0e0M","mode-cell":"RangeDatePicker_mode-cell__neiVz","typographyHeader":"RangeDatePicker_typography-header__1MSa3","typographyBlock":"RangeDatePicker_typography-block__pC0T7","typographyInline":"RangeDatePicker_typography-inline__efdyU","typography16":"RangeDatePicker_typography-16__FHiRR","typography14":"RangeDatePicker_typography-14__5MCXV","typography12":"RangeDatePicker_typography-12__zcQS2","typographyPromo":"RangeDatePicker_typography-promo__GtLFC RangeDatePicker_typography-header__1MSa3 RangeDatePicker_typography-block__pC0T7 RangeDatePicker_typography-inline__efdyU","dropdownContainer":"RangeDatePicker_dropdown-container__GJh6o","buttonGroup":"RangeDatePicker_button-group__a-twv","dateInput":"RangeDatePicker_date-input__2aXJj","size24":"RangeDatePicker_size-24__64v-x","size30":"RangeDatePicker_size-30__7OPWW","size36":"RangeDatePicker_size-36__urHhS","size42":"RangeDatePicker_size-42__VMCut","size48":"RangeDatePicker_size-48__YHcLe","dateInputGroup":"RangeDatePicker_date-input-group__CGdCd","modeForm":"RangeDatePicker_mode-form__o0e0M","modeCell":"RangeDatePicker_mode-cell__neiVz"};
|
|
1314
|
+
|
|
1315
|
+
const defaultValue = { from: null, to: null };
|
|
1316
|
+
class RangeDatePicker extends BaseRangeDatePicker {
|
|
1317
|
+
constructor() {
|
|
1318
|
+
super(...arguments);
|
|
1319
|
+
this.renderInput = (props) => {
|
|
1320
|
+
var _a, _b;
|
|
1321
|
+
return (React.createElement("div", { className: cx(this.props.inputCx, css$D.dateInputGroup, this.props.isDisabled && uuiMod.disabled, this.props.isReadonly && uuiMod.readonly, this.props.isInvalid && uuiMod.invalid, this.state.inFocus && uuiMod.focus), onClick: !this.props.isDisabled && props.onClick, onBlur: this.handleWrapperBlur, ref: props.ref },
|
|
1322
|
+
React.createElement(TextInput, { icon: systemIcons[this.props.size || '36'].calendar, cx: cx(css$D.dateInput, css$D['size-' + (this.props.size || 36)], this.state.inFocus === 'from' && uuiMod.focus), size: this.props.size || '36', placeholder: this.props.getPlaceholder ? this.props.getPlaceholder('from') : i18n.rangeDatePicker.pickerPlaceholderFrom, value: this.state.inputValue.from, onValueChange: this.getChangeHandler('from'), isInvalid: this.props.isInvalid, isDisabled: this.props.isDisabled, isReadonly: this.props.isReadonly, onFocus: (event) => this.handleFocus(event, 'from'), onBlur: (event) => this.handleBlur(event, 'from'), isDropdown: false, rawProps: (_a = this.props.rawProps) === null || _a === void 0 ? void 0 : _a.from }),
|
|
1323
|
+
React.createElement("div", { className: css$D.separator }),
|
|
1324
|
+
React.createElement(TextInput, { cx: cx(css$D.dateInput, css$D['size-' + (this.props.size || 36)], this.state.inFocus === 'to' && uuiMod.focus), placeholder: this.props.getPlaceholder ? this.props.getPlaceholder('to') : i18n.rangeDatePicker.pickerPlaceholderTo, size: this.props.size || '36', value: this.state.inputValue.to, onCancel: this.props.disableClear ? null : this.state.inputValue.from && this.state.inputValue.to && this.handleCancel, onValueChange: this.getChangeHandler('to'), isInvalid: this.props.isInvalid, isDisabled: this.props.isDisabled, isReadonly: this.props.isReadonly, onFocus: (e) => this.handleFocus(e, 'to'), onBlur: (e) => this.handleBlur(e, 'to'), isDropdown: false, rawProps: (_b = this.props.rawProps) === null || _b === void 0 ? void 0 : _b.to })));
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
renderBody(props) {
|
|
1328
|
+
var _a;
|
|
1329
|
+
return (React.createElement(DropdownContainer, Object.assign({}, props, { cx: cx(css$D.dropdownContainer) }),
|
|
1330
|
+
React.createElement(FlexRow, null,
|
|
1331
|
+
React.createElement(RangeDatePickerBody, { cx: cx(this.props.bodyCx), value: this.getValue(), onValueChange: this.onRangeChange, filter: this.props.filter, changeIsOpen: this.toggleOpening, presets: this.props.presets, focusPart: this.state.inFocus, renderDay: this.props.renderDay, renderFooter: this.props.renderFooter && (() => this.props.renderFooter(this.props.value || defaultValue)), isHoliday: this.props.isHoliday, rawProps: (_a = this.props.rawProps) === null || _a === void 0 ? void 0 : _a.body }))));
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
var css$C = {"typography-header":"DropMarker_typography-header__W65wc","typography-block":"DropMarker_typography-block__uaCk0","typography-inline":"DropMarker_typography-inline__tZ3Y-","typography-16":"DropMarker_typography-16__o-pNo","typography-14":"DropMarker_typography-14__so29S","typography-12":"DropMarker_typography-12__UmnG8","typography-promo":"DropMarker_typography-promo__rioi4 DropMarker_typography-header__W65wc DropMarker_typography-block__uaCk0 DropMarker_typography-inline__tZ3Y-","blocker":"DropMarker_blocker__x-t-D","marker":"DropMarker_marker__5weO4","top":"DropMarker_top__a-UDx","bottom":"DropMarker_bottom__kUP91","left":"DropMarker_left__w5JwO","right":"DropMarker_right__zAmSs","inside":"DropMarker_inside__SfmMo","typographyHeader":"DropMarker_typography-header__W65wc","typographyBlock":"DropMarker_typography-block__uaCk0","typographyInline":"DropMarker_typography-inline__tZ3Y-","typography16":"DropMarker_typography-16__o-pNo","typography14":"DropMarker_typography-14__so29S","typography12":"DropMarker_typography-12__UmnG8","typographyPromo":"DropMarker_typography-promo__rioi4 DropMarker_typography-header__W65wc DropMarker_typography-block__uaCk0 DropMarker_typography-inline__tZ3Y-"};
|
|
1336
|
+
|
|
1337
|
+
class DropMarker extends React.Component {
|
|
1338
|
+
render() {
|
|
1339
|
+
var _a;
|
|
1340
|
+
return this.props.isDndInProgress ? (React.createElement(React.Fragment, null,
|
|
1341
|
+
this.props.enableBlocker && React.createElement("div", { className: css$C.blocker }),
|
|
1342
|
+
React.createElement("div", { className: cx([
|
|
1343
|
+
css$C.marker, css$C[this.props.position],
|
|
1344
|
+
(_a = this.props) === null || _a === void 0 ? void 0 : _a.cx,
|
|
1345
|
+
]) }))) : null;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
var css$B = {"typography-header":"DataPickerBody_typography-header__AlPy4","typography-block":"DataPickerBody_typography-block__BIQe2","typography-inline":"DataPickerBody_typography-inline__lOHW0","typography-16":"DataPickerBody_typography-16__P2rqG","typography-14":"DataPickerBody_typography-14__kmNXP","typography-12":"DataPickerBody_typography-12__W2f-m","typography-promo":"DataPickerBody_typography-promo__VoJO5 DataPickerBody_typography-header__AlPy4 DataPickerBody_typography-block__BIQe2 DataPickerBody_typography-inline__lOHW0","body":"DataPickerBody_body__9Atow","modal":"DataPickerBody_modal__zvOE2","search-wrapper":"DataPickerBody_search-wrapper__UeG2b","checkbox":"DataPickerBody_checkbox__EFs7y","no-found-size-24":"DataPickerBody_no-found-size-24__4RC9-","no-found-size-30":"DataPickerBody_no-found-size-30__M8eYW","no-found-size-36":"DataPickerBody_no-found-size-36__jr82u","no-found-size-42":"DataPickerBody_no-found-size-42__9WVA5","typographyHeader":"DataPickerBody_typography-header__AlPy4","typographyBlock":"DataPickerBody_typography-block__BIQe2","typographyInline":"DataPickerBody_typography-inline__lOHW0","typography16":"DataPickerBody_typography-16__P2rqG","typography14":"DataPickerBody_typography-14__kmNXP","typography12":"DataPickerBody_typography-12__W2f-m","typographyPromo":"DataPickerBody_typography-promo__VoJO5 DataPickerBody_typography-header__AlPy4 DataPickerBody_typography-block__BIQe2 DataPickerBody_typography-inline__lOHW0","searchWrapper":"DataPickerBody_search-wrapper__UeG2b","noFoundSize24":"DataPickerBody_no-found-size-24__4RC9-","noFoundSize30":"DataPickerBody_no-found-size-30__M8eYW","noFoundSize36":"DataPickerBody_no-found-size-36__jr82u","noFoundSize42":"DataPickerBody_no-found-size-42__9WVA5"};
|
|
1350
|
+
|
|
1351
|
+
class DataPickerBody extends PickerBodyBase {
|
|
1352
|
+
constructor() {
|
|
1353
|
+
super(...arguments);
|
|
1354
|
+
this.lens = Lens.onEditableComponent(this);
|
|
1355
|
+
this.searchLens = this.lens.prop('search');
|
|
1356
|
+
}
|
|
1357
|
+
renderNotFound() {
|
|
1358
|
+
if (this.props.renderNotFound) {
|
|
1359
|
+
return this.props.renderNotFound();
|
|
1360
|
+
}
|
|
1361
|
+
return (React__default.createElement(FlexCell$1, { cx: css$B[`no-found-size-${this.props.searchSize || 36}`], grow: 1, textAlign: "center" },
|
|
1362
|
+
React__default.createElement(Text, { size: this.props.searchSize || '36' }, i18n.dataPickerBody.noRecordsMessage)));
|
|
1363
|
+
}
|
|
1364
|
+
render() {
|
|
1365
|
+
const searchSize = isMobile() ? '48' : this.props.searchSize || '36';
|
|
1366
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
1367
|
+
this.showSearch() && (React__default.createElement("div", { key: "search", className: css$B.searchWrapper },
|
|
1368
|
+
React__default.createElement(FlexCell$1, { grow: 1 },
|
|
1369
|
+
React__default.createElement(SearchInput, Object.assign({ ref: this.searchRef, placeholder: i18n.dataPickerBody.searchPlaceholder }, this.searchLens.toProps(), { onKeyDown: this.searchKeyDown, size: searchSize }))))),
|
|
1370
|
+
React__default.createElement(FlexRow, { key: "body", cx: cx$1(css$B.body, css$B[this.props.editMode], css$B[this.props.selectionMode]), rawProps: { style: { maxHeight: this.props.maxHeight } } }, this.props.rowsCount > 0 ? (React__default.createElement(VirtualList, Object.assign({}, this.lens.toProps(), { rows: this.props.rows, role: "listbox", rawProps: this.props.rawProps, rowsCount: this.props.rowsCount }))) : (this.renderNotFound()))));
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
const switchSizes = {
|
|
1375
|
+
24: '12',
|
|
1376
|
+
36: '18',
|
|
1377
|
+
42: '24',
|
|
1378
|
+
48: '24',
|
|
1379
|
+
};
|
|
1380
|
+
function DataPickerFooterImpl(props) {
|
|
1381
|
+
const { clearSelection, view, showSelected, selectionMode, } = props;
|
|
1382
|
+
const size = isMobile() ? '48' : props.size || '36';
|
|
1383
|
+
const switchSize = switchSizes[size];
|
|
1384
|
+
const hasSelection = view.getSelectedRowsCount() > 0;
|
|
1385
|
+
const isSinglePicker = selectionMode === 'single';
|
|
1386
|
+
const clearAllText = i18n.pickerInput.clearSelectionButton;
|
|
1387
|
+
const clearSingleText = i18n.pickerInput.clearSelectionButtonSingle;
|
|
1388
|
+
const selectAllText = i18n.pickerInput.selectAllButton;
|
|
1389
|
+
const handleKeyDown = (e) => {
|
|
1390
|
+
if (!e.shiftKey && e.key === 'Tab')
|
|
1391
|
+
e.preventDefault();
|
|
1392
|
+
};
|
|
1393
|
+
return (React__default.createElement(FlexRow, { padding: "12" },
|
|
1394
|
+
!isSinglePicker && (React__default.createElement(Switch, { size: switchSize, value: showSelected.value, isDisabled: !hasSelection, onValueChange: showSelected.onValueChange, label: i18n.pickerInput.showOnlySelectedLabel })),
|
|
1395
|
+
React__default.createElement(FlexSpacer, null),
|
|
1396
|
+
React__default.createElement(FlexCell, { width: "auto", alignSelf: "center" },
|
|
1397
|
+
view.selectAll && (React__default.createElement(LinkButton, { size: size, caption: hasSelection ? clearAllText : selectAllText, onClick: hasSelection ? clearSelection : () => view.selectAll.onValueChange(true), rawProps: { onKeyDown: handleKeyDown } })),
|
|
1398
|
+
!view.selectAll && (React__default.createElement(LinkButton, { isDisabled: !hasSelection, size: size, caption: isSinglePicker ? clearSingleText : clearAllText, onClick: clearSelection, rawProps: { onKeyDown: handleKeyDown } })))));
|
|
1399
|
+
}
|
|
1400
|
+
const DataPickerFooter = React__default.memo(DataPickerFooterImpl);
|
|
1401
|
+
|
|
1402
|
+
var css$A = {"header":"DataPickerHeader_header__UDMhr","close":"DataPickerHeader_close__30pW6"};
|
|
1403
|
+
|
|
1404
|
+
var _path$z;
|
|
1405
|
+
function _extends$B() { _extends$B = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$B.apply(this, arguments); }
|
|
1406
|
+
var SvgNavigationClose24 = function SvgNavigationClose24(props, ref) {
|
|
1407
|
+
return /*#__PURE__*/React.createElement("svg", _extends$B({
|
|
1408
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1409
|
+
width: 24,
|
|
1410
|
+
height: 24,
|
|
1411
|
+
viewBox: "0 0 24 24",
|
|
1412
|
+
ref: ref
|
|
1413
|
+
}, props), _path$z || (_path$z = /*#__PURE__*/React.createElement("path", {
|
|
1414
|
+
fillRule: "evenodd",
|
|
1415
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",
|
|
1416
|
+
clipRule: "evenodd"
|
|
1417
|
+
})));
|
|
1418
|
+
};
|
|
1419
|
+
var ForwardRef$B = /*#__PURE__*/forwardRef(SvgNavigationClose24);
|
|
1420
|
+
|
|
1421
|
+
const DataPickerHeaderImpl = (props) => {
|
|
1422
|
+
const title = props.title && typeof props.title === 'string' ? props.title.charAt(0).toUpperCase() + props.title.slice(1) : '';
|
|
1423
|
+
return (React__default.createElement(FlexRow, { alignItems: "center", borderBottom: true, size: "48", cx: css$A.header },
|
|
1424
|
+
React__default.createElement(Text, { font: "semibold" }, title),
|
|
1425
|
+
React__default.createElement(IconButton, { icon: ForwardRef$B, onClick: () => { var _a; return (_a = props.close) === null || _a === void 0 ? void 0 : _a.call(props); }, cx: css$A.close })));
|
|
1426
|
+
};
|
|
1427
|
+
const DataPickerHeader = React__default.memo(DataPickerHeaderImpl);
|
|
1428
|
+
|
|
1429
|
+
var _defs$1, _use;
|
|
1430
|
+
function _extends$A() { _extends$A = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$A.apply(this, arguments); }
|
|
1431
|
+
var SvgTreeFoldingArrow = function SvgTreeFoldingArrow(props, ref) {
|
|
1432
|
+
return /*#__PURE__*/React.createElement("svg", _extends$A({
|
|
1433
|
+
width: 18,
|
|
1434
|
+
height: 18,
|
|
1435
|
+
viewBox: "0 0 18 18",
|
|
1436
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1437
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1438
|
+
ref: ref
|
|
1439
|
+
}, props), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("path", {
|
|
1440
|
+
id: "a",
|
|
1441
|
+
d: "M6.056 6.998a.997.997 0 0 1-.769-.29L.293 1.712a1 1 0 0 1 0-1.414L.299.293a1 1 0 0 1 1.414 0L6 4.58 10.288.293c.39-.39 1.023-.39 1.42.006a1 1 0 0 1 0 1.414L6.712 6.707a.993.993 0 0 1-.657.291z"
|
|
1442
|
+
}))), _use || (_use = /*#__PURE__*/React.createElement("use", {
|
|
1443
|
+
width: "100%",
|
|
1444
|
+
height: "100%",
|
|
1445
|
+
xlinkHref: "#a",
|
|
1446
|
+
transform: "translate(3.893 6.02) scale(.8512)",
|
|
1447
|
+
fillRule: "evenodd"
|
|
1448
|
+
})));
|
|
1449
|
+
};
|
|
1450
|
+
var ForwardRef$A = /*#__PURE__*/forwardRef(SvgTreeFoldingArrow);
|
|
1451
|
+
|
|
1452
|
+
var css$z = {"cell":"DataTableCell_cell__VgHTT","wrapper":"DataTableCell_wrapper__6hBNx","align-widgets-top":"DataTableCell_align-widgets-top__7LNVl","size-24":"DataTableCell_size-24__g6m7O","folding-arrow":"DataTableCell_folding-arrow__6iI4s","size-30":"DataTableCell_size-30__hpjkm","size-36":"DataTableCell_size-36__8qiBq","size-42":"DataTableCell_size-42__jJMhr","size-48":"DataTableCell_size-48__XXrAx","size-60":"DataTableCell_size-60__0XLPh","align-widgets-center":"DataTableCell_align-widgets-center__VXHNb","padding-12":"DataTableCell_padding-12__xvGe5","padding-24":"DataTableCell_padding-24__r322g","padding-left-12":"DataTableCell_padding-left-12__g6QSx","padding-left-24":"DataTableCell_padding-left-24__vm-bI","padding-right-24":"DataTableCell_padding-right-24__CjNWh","drag-handle":"DataTableCell_drag-handle__Ge7UM","checkbox":"DataTableCell_checkbox__sY2kh","indent":"DataTableCell_indent__lcZWO","folding-arrow-12":"DataTableCell_folding-arrow-12__mVKaH","folding-arrow-18":"DataTableCell_folding-arrow-18__hiEIW","icon-container":"DataTableCell_icon-container__1fR7V","alignWidgetsTop":"DataTableCell_align-widgets-top__7LNVl","size24":"DataTableCell_size-24__g6m7O","foldingArrow":"DataTableCell_folding-arrow__6iI4s","size30":"DataTableCell_size-30__hpjkm","size36":"DataTableCell_size-36__8qiBq","size42":"DataTableCell_size-42__jJMhr","size48":"DataTableCell_size-48__XXrAx","size60":"DataTableCell_size-60__0XLPh","alignWidgetsCenter":"DataTableCell_align-widgets-center__VXHNb","padding12":"DataTableCell_padding-12__xvGe5","padding24":"DataTableCell_padding-24__r322g","paddingLeft12":"DataTableCell_padding-left-12__g6QSx","paddingLeft24":"DataTableCell_padding-left-24__vm-bI","paddingRight24":"DataTableCell_padding-right-24__CjNWh","dragHandle":"DataTableCell_drag-handle__Ge7UM","foldingArrow12":"DataTableCell_folding-arrow-12__mVKaH","foldingArrow18":"DataTableCell_folding-arrow-18__hiEIW","iconContainer":"DataTableCell_icon-container__1fR7V"};
|
|
1453
|
+
|
|
1454
|
+
function DataTableRowAddons(props) {
|
|
1455
|
+
var _a, _b;
|
|
1456
|
+
const row = props.rowProps;
|
|
1457
|
+
const additionalItemSize = +props.size < 30 ? '12' : '18';
|
|
1458
|
+
return (React.createElement(React.Fragment, null,
|
|
1459
|
+
((_a = row.dnd) === null || _a === void 0 ? void 0 : _a.srcData) && React.createElement(DragHandle, { key: "dh", cx: css$z.dragHandle }),
|
|
1460
|
+
((_b = row === null || row === void 0 ? void 0 : row.checkbox) === null || _b === void 0 ? void 0 : _b.isVisible) && (React.createElement(Checkbox, { key: "cb", cx: css$z.checkbox, tabIndex: props.tabIndex, size: additionalItemSize, value: row.isChecked, indeterminate: !row.isChecked && row.isChildrenChecked, onValueChange: () => row.onCheck(row), isDisabled: row.checkbox.isDisabled, isInvalid: row.checkbox.isInvalid })),
|
|
1461
|
+
row.indent > 0 && (React.createElement("div", { key: "fold", className: css$z.indent, style: { marginLeft: (row.indent - 1) * 24 } }, row.isFoldable && (React.createElement(IconContainer, { key: "icon", icon: ForwardRef$A, cx: [
|
|
1462
|
+
css$z.foldingArrow, css$z[`folding-arrow-${additionalItemSize}`], uuiMarkers.clickable, css$z.iconContainer,
|
|
1463
|
+
], rotate: row.isFolded ? '90ccw' : '0', onClick: () => row.onFold(row) }))))));
|
|
1464
|
+
}
|
|
1465
|
+
function DataTableCell(props) {
|
|
1466
|
+
props = Object.assign({}, props);
|
|
1467
|
+
if (props.isFirstColumn) {
|
|
1468
|
+
props.addons = React.createElement(DataTableRowAddons, Object.assign({}, props));
|
|
1469
|
+
}
|
|
1470
|
+
props.renderPlaceholder = props.renderPlaceholder
|
|
1471
|
+
|| (() => (React.createElement(Text, { key: "t", size: props.size != '60' ? props.size : '48' },
|
|
1472
|
+
React.createElement(TextPlaceholder, null))));
|
|
1473
|
+
props.renderTooltip = (tooltipProps) => React.createElement(Tooltip, Object.assign({ color: "critical" }, tooltipProps));
|
|
1474
|
+
const isEditable = !!props.onValueChange;
|
|
1475
|
+
props.cx = [
|
|
1476
|
+
'data-table-cell', props.cx, css$z.cell, css$z['size-' + (props.size || '36')], css$z[`padding-${props.padding || (isEditable && !props.rowProps.isLoading && '0') || '12'}`], props.isFirstColumn && css$z[`padding-left-${props.padding || '24'}`], props.isLastColumn && css$z['padding-right-24'], css$z[`align-widgets-${props.alignActions || 'top'}`], (props.border || isEditable) && 'uui-dt-vertical-cell-border',
|
|
1477
|
+
];
|
|
1478
|
+
return React.createElement(DataTableCell$1, Object.assign({}, props));
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
var css$y = {"typography-header":"DataTableRow_typography-header__uNO7L","typography-block":"DataTableRow_typography-block__tHe35","typography-inline":"DataTableRow_typography-inline__KgXSh","typography-16":"DataTableRow_typography-16__gMKvg","typography-14":"DataTableRow_typography-14__itR0W","typography-12":"DataTableRow_typography-12__G4k4k","typography-promo":"DataTableRow_typography-promo__LE-gA DataTableRow_typography-header__uNO7L DataTableRow_typography-block__tHe35 DataTableRow_typography-inline__KgXSh","root":"DataTableRow_root__ThnfZ","size-24":"DataTableRow_size-24__mjGKU","size-30":"DataTableRow_size-30__Kb8nP","size-36":"DataTableRow_size-36__dolOJ","size-48":"DataTableRow_size-48__DpAQX","size-60":"DataTableRow_size-60__k0ZKS","typographyHeader":"DataTableRow_typography-header__uNO7L","typographyBlock":"DataTableRow_typography-block__tHe35","typographyInline":"DataTableRow_typography-inline__KgXSh","typography16":"DataTableRow_typography-16__gMKvg","typography14":"DataTableRow_typography-14__itR0W","typography12":"DataTableRow_typography-12__G4k4k","typographyPromo":"DataTableRow_typography-promo__LE-gA DataTableRow_typography-header__uNO7L DataTableRow_typography-block__tHe35 DataTableRow_typography-inline__KgXSh","size24":"DataTableRow_size-24__mjGKU","size30":"DataTableRow_size-30__Kb8nP","size36":"DataTableRow_size-36__dolOJ","size48":"DataTableRow_size-48__DpAQX","size60":"DataTableRow_size-60__k0ZKS"};
|
|
1482
|
+
|
|
1483
|
+
// Here we define a single instance of the renderCell function to make DataTableRow#shouldComponentUpdate work.
|
|
1484
|
+
// As we need our mods to style the cell properly, we extract them from DataTableCellProps.rowProps, which is a hack, but it's reliable enough.
|
|
1485
|
+
const renderCell = (props) => {
|
|
1486
|
+
const mods = props.rowProps;
|
|
1487
|
+
return React.createElement(DataTableCell, Object.assign({ size: mods.size }, props));
|
|
1488
|
+
};
|
|
1489
|
+
const renderDropMarkers = (props) => React.createElement(DropMarker, Object.assign({}, props, { enableBlocker: true }));
|
|
1490
|
+
const propsMods = { renderCell, renderDropMarkers };
|
|
1491
|
+
const DataTableRow = withMods(DataTableRow$1, ({ borderBottom = true, size }) => {
|
|
1492
|
+
return [
|
|
1493
|
+
css$y.root, borderBottom && 'uui-dt-row-border', css$y['size-' + (size || '36')],
|
|
1494
|
+
];
|
|
1495
|
+
}, () => propsMods);
|
|
1496
|
+
|
|
1497
|
+
var css$x = {"typography-header":"DataTableHeaderRow_typography-header__17Mf0","typography-block":"DataTableHeaderRow_typography-block__qHB6b","typography-inline":"DataTableHeaderRow_typography-inline__lCA-Y","typography-16":"DataTableHeaderRow_typography-16__ZijSq","typography-14":"DataTableHeaderRow_typography-14__wGc4t","typography-12":"DataTableHeaderRow_typography-12__spGat","typography-promo":"DataTableHeaderRow_typography-promo__j-vYv DataTableHeaderRow_typography-header__17Mf0 DataTableHeaderRow_typography-block__qHB6b DataTableHeaderRow_typography-inline__lCA-Y","header-cell":"DataTableHeaderRow_header-cell__KtC6r","config-icon":"DataTableHeaderRow_config-icon__w0uLR","typographyHeader":"DataTableHeaderRow_typography-header__17Mf0","typographyBlock":"DataTableHeaderRow_typography-block__qHB6b","typographyInline":"DataTableHeaderRow_typography-inline__lCA-Y","typography16":"DataTableHeaderRow_typography-16__ZijSq","typography14":"DataTableHeaderRow_typography-14__wGc4t","typography12":"DataTableHeaderRow_typography-12__spGat","typographyPromo":"DataTableHeaderRow_typography-promo__j-vYv DataTableHeaderRow_typography-header__17Mf0 DataTableHeaderRow_typography-block__qHB6b DataTableHeaderRow_typography-inline__lCA-Y","headerCell":"DataTableHeaderRow_header-cell__KtC6r","configIcon":"DataTableHeaderRow_config-icon__w0uLR"};
|
|
1498
|
+
|
|
1499
|
+
var _path$y;
|
|
1500
|
+
function _extends$z() { _extends$z = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
|
|
1501
|
+
var SvgActionSettings18 = function SvgActionSettings18(props, ref) {
|
|
1502
|
+
return /*#__PURE__*/React.createElement("svg", _extends$z({
|
|
1503
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1504
|
+
width: 18,
|
|
1505
|
+
height: 18,
|
|
1506
|
+
viewBox: "0 0 18 18",
|
|
1507
|
+
ref: ref
|
|
1508
|
+
}, props), _path$y || (_path$y = /*#__PURE__*/React.createElement("path", {
|
|
1509
|
+
fillRule: "evenodd",
|
|
1510
|
+
d: "M3 9.093a6.083 6.083 0 0 1 0-.186L1.55 7.271a1 1 0 0 1-.118-1.163l1.28-2.216a1 1 0 0 1 1.066-.48l2.14.439a3.81 3.81 0 0 1 .163-.094l.691-2.073A1 1 0 0 1 7.721 1h2.558a1 1 0 0 1 .949.684l.69 2.073c.056.03.11.061.163.094l2.141-.439a1 1 0 0 1 1.067.48l1.279 2.216a1 1 0 0 1-.118 1.163L15 8.907a5.72 5.72 0 0 1 0 .186l1.45 1.636a1 1 0 0 1 .118 1.163l-1.28 2.216a1 1 0 0 1-1.066.48l-2.14-.438a6.215 6.215 0 0 1-.163.093l-.691 2.073a1 1 0 0 1-.949.684H7.721a1 1 0 0 1-.949-.684l-.69-2.073a6.105 6.105 0 0 1-.163-.094l-2.141.439a1 1 0 0 1-1.067-.48l-1.279-2.216a1 1 0 0 1 .118-1.163L3 9.093zM9 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",
|
|
1511
|
+
clipRule: "evenodd"
|
|
1512
|
+
})));
|
|
1513
|
+
};
|
|
1514
|
+
var ForwardRef$z = /*#__PURE__*/forwardRef(SvgActionSettings18);
|
|
1515
|
+
|
|
1516
|
+
const DataTableHeaderRow = withMods(DataTableHeaderRow$1, (mods) => [css$x.root], (mods) => ({
|
|
1517
|
+
renderCell: (props) => React.createElement(DataTableHeaderCell, Object.assign({}, props, { size: mods.size, textCase: mods.textCase || 'normal', key: props.column.key })),
|
|
1518
|
+
renderConfigButton: () => React.createElement(IconButton, { key: "configuration", onClick: mods.onConfigButtonClick, cx: css$x.configIcon, color: "default", icon: ForwardRef$z }),
|
|
1519
|
+
}));
|
|
1520
|
+
|
|
1521
|
+
var css$w = {"typography-header":"DataTableHeaderCell_typography-header__oILYa","typography-block":"DataTableHeaderCell_typography-block__BQMtM","typography-inline":"DataTableHeaderCell_typography-inline__cfsue","typography-16":"DataTableHeaderCell_typography-16__ZEqH6","typography-14":"DataTableHeaderCell_typography-14__keNR5","typography-12":"DataTableHeaderCell_typography-12__PhqnS","typography-promo":"DataTableHeaderCell_typography-promo__G4UmR DataTableHeaderCell_typography-header__oILYa DataTableHeaderCell_typography-block__BQMtM DataTableHeaderCell_typography-inline__cfsue","cell":"DataTableHeaderCell_cell__8JnbB","sort-icon":"DataTableHeaderCell_sort-icon__Wi-rh","dropdown-icon":"DataTableHeaderCell_dropdown-icon__-vO3u","infoIcon":"DataTableHeaderCell_infoIcon__1Ang4","resizable":"DataTableHeaderCell_resizable__sNvwo","size-24":"DataTableHeaderCell_size-24__ntP26","size-30":"DataTableHeaderCell_size-30__znptx","size-36":"DataTableHeaderCell_size-36__m5DC6","size-42":"DataTableHeaderCell_size-42__YX4yM","size-48":"DataTableHeaderCell_size-48__YCyCX","padding-left-24":"DataTableHeaderCell_padding-left-24__sZhuC","padding-right-24":"DataTableHeaderCell_padding-right-24__5Ne7M","caption":"DataTableHeaderCell_caption__pF7VF","checkbox":"DataTableHeaderCell_checkbox__sg2V-","icon":"DataTableHeaderCell_icon__XDYeh","icon-cell":"DataTableHeaderCell_icon-cell__t-wBF","align-right":"DataTableHeaderCell_align-right__JzZ-h","align-center":"DataTableHeaderCell_align-center__BegNE","tooltip-wrapper":"DataTableHeaderCell_tooltip-wrapper__ILECw","cell-tooltip":"DataTableHeaderCell_cell-tooltip__XAI4G","upper-case":"DataTableHeaderCell_upper-case__YCQ24","font-size-14":"DataTableHeaderCell_font-size-14__3JeGt","resize-mark":"DataTableHeaderCell_resize-mark__Vlv3w","draggable":"DataTableHeaderCell_draggable__c0dne","ghost":"DataTableHeaderCell_ghost__Yjb5B","is-dragged-out":"DataTableHeaderCell_is-dragged-out__HzBd6","dnd-marker-left":"DataTableHeaderCell_dnd-marker-left__0pkPC","dnd-marker-right":"DataTableHeaderCell_dnd-marker-right__1i9gh","typographyHeader":"DataTableHeaderCell_typography-header__oILYa","typographyBlock":"DataTableHeaderCell_typography-block__BQMtM","typographyInline":"DataTableHeaderCell_typography-inline__cfsue","typography16":"DataTableHeaderCell_typography-16__ZEqH6","typography14":"DataTableHeaderCell_typography-14__keNR5","typography12":"DataTableHeaderCell_typography-12__PhqnS","typographyPromo":"DataTableHeaderCell_typography-promo__G4UmR DataTableHeaderCell_typography-header__oILYa DataTableHeaderCell_typography-block__BQMtM DataTableHeaderCell_typography-inline__cfsue","sortIcon":"DataTableHeaderCell_sort-icon__Wi-rh","dropdownIcon":"DataTableHeaderCell_dropdown-icon__-vO3u","size24":"DataTableHeaderCell_size-24__ntP26","size30":"DataTableHeaderCell_size-30__znptx","size36":"DataTableHeaderCell_size-36__m5DC6","size42":"DataTableHeaderCell_size-42__YX4yM","size48":"DataTableHeaderCell_size-48__YCyCX","paddingLeft24":"DataTableHeaderCell_padding-left-24__sZhuC","paddingRight24":"DataTableHeaderCell_padding-right-24__5Ne7M","iconCell":"DataTableHeaderCell_icon-cell__t-wBF","alignRight":"DataTableHeaderCell_align-right__JzZ-h","alignCenter":"DataTableHeaderCell_align-center__BegNE","tooltipWrapper":"DataTableHeaderCell_tooltip-wrapper__ILECw","cellTooltip":"DataTableHeaderCell_cell-tooltip__XAI4G","upperCase":"DataTableHeaderCell_upper-case__YCQ24","fontSize14":"DataTableHeaderCell_font-size-14__3JeGt","resizeMark":"DataTableHeaderCell_resize-mark__Vlv3w","isDraggedOut":"DataTableHeaderCell_is-dragged-out__HzBd6","dndMarkerLeft":"DataTableHeaderCell_dnd-marker-left__0pkPC","dndMarkerRight":"DataTableHeaderCell_dnd-marker-right__1i9gh"};
|
|
1522
|
+
|
|
1523
|
+
var _path$x;
|
|
1524
|
+
function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
|
|
1525
|
+
var SvgTableSwap18 = function SvgTableSwap18(props, ref) {
|
|
1526
|
+
return /*#__PURE__*/React.createElement("svg", _extends$y({
|
|
1527
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1528
|
+
width: 18,
|
|
1529
|
+
height: 18,
|
|
1530
|
+
viewBox: "0 0 18 18",
|
|
1531
|
+
ref: ref
|
|
1532
|
+
}, props), _path$x || (_path$x = /*#__PURE__*/React.createElement("path", {
|
|
1533
|
+
fillRule: "evenodd",
|
|
1534
|
+
d: "M6 1 2 5h3v7h2V5h3L6 1zm7 12V6h-2v7H8l4 4 4-4h-3z",
|
|
1535
|
+
clipRule: "evenodd"
|
|
1536
|
+
})));
|
|
1537
|
+
};
|
|
1538
|
+
var ForwardRef$y = /*#__PURE__*/forwardRef(SvgTableSwap18);
|
|
1539
|
+
|
|
1540
|
+
var _path$w;
|
|
1541
|
+
function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
|
|
1542
|
+
var SvgTableSortAsc18 = function SvgTableSortAsc18(props, ref) {
|
|
1543
|
+
return /*#__PURE__*/React.createElement("svg", _extends$x({
|
|
1544
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1545
|
+
width: 18,
|
|
1546
|
+
height: 18,
|
|
1547
|
+
viewBox: "0 0 18 18",
|
|
1548
|
+
ref: ref
|
|
1549
|
+
}, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
|
|
1550
|
+
fillRule: "evenodd",
|
|
1551
|
+
d: "M10 6v10H8V6H5l4-4 4 4h-3z",
|
|
1552
|
+
clipRule: "evenodd"
|
|
1553
|
+
})));
|
|
1554
|
+
};
|
|
1555
|
+
var ForwardRef$x = /*#__PURE__*/forwardRef(SvgTableSortAsc18);
|
|
1556
|
+
|
|
1557
|
+
var _path$v;
|
|
1558
|
+
function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
|
|
1559
|
+
var SvgTableSortDesc18 = function SvgTableSortDesc18(props, ref) {
|
|
1560
|
+
return /*#__PURE__*/React.createElement("svg", _extends$w({
|
|
1561
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1562
|
+
width: 18,
|
|
1563
|
+
height: 18,
|
|
1564
|
+
viewBox: "0 0 18 18",
|
|
1565
|
+
ref: ref
|
|
1566
|
+
}, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
|
|
1567
|
+
fillRule: "evenodd",
|
|
1568
|
+
d: "M10 12V2H8v10H5l4 4 4-4h-3z",
|
|
1569
|
+
clipRule: "evenodd"
|
|
1570
|
+
})));
|
|
1571
|
+
};
|
|
1572
|
+
var ForwardRef$w = /*#__PURE__*/forwardRef(SvgTableSortDesc18);
|
|
1573
|
+
|
|
1574
|
+
var _path$u;
|
|
1575
|
+
function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
|
|
1576
|
+
var SvgContentFiltration18 = function SvgContentFiltration18(props, ref) {
|
|
1577
|
+
return /*#__PURE__*/React.createElement("svg", _extends$v({
|
|
1578
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1579
|
+
width: 18,
|
|
1580
|
+
height: 18,
|
|
1581
|
+
viewBox: "0 0 18 18",
|
|
1582
|
+
ref: ref
|
|
1583
|
+
}, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
|
|
1584
|
+
fillRule: "evenodd",
|
|
1585
|
+
d: "m8 14 2 2v-5H8v3zM2 3v2h14V3H2zm6 8h2l6-6H2l6 6z",
|
|
1586
|
+
clipRule: "evenodd"
|
|
1587
|
+
})));
|
|
1588
|
+
};
|
|
1589
|
+
var ForwardRef$v = /*#__PURE__*/forwardRef(SvgContentFiltration18);
|
|
1590
|
+
|
|
1591
|
+
var _path$t;
|
|
1592
|
+
function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
|
|
1593
|
+
var SvgNavigationChevronDown18 = function SvgNavigationChevronDown18(props, ref) {
|
|
1594
|
+
return /*#__PURE__*/React.createElement("svg", _extends$u({
|
|
1595
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1596
|
+
width: 18,
|
|
1597
|
+
height: 18,
|
|
1598
|
+
viewBox: "0 0 18 18",
|
|
1599
|
+
ref: ref
|
|
1600
|
+
}, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
|
|
1601
|
+
fillRule: "evenodd",
|
|
1602
|
+
d: "M12.443 6.442 9 9.877 5.558 6.442 4.5 7.5 9 12l4.5-4.5-1.057-1.058z",
|
|
1603
|
+
clipRule: "evenodd"
|
|
1604
|
+
})));
|
|
1605
|
+
};
|
|
1606
|
+
var ForwardRef$u = /*#__PURE__*/forwardRef(SvgNavigationChevronDown18);
|
|
1607
|
+
|
|
1608
|
+
var _path$s;
|
|
1609
|
+
function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
|
|
1610
|
+
var SvgNavigationChevronUp18 = function SvgNavigationChevronUp18(props, ref) {
|
|
1611
|
+
return /*#__PURE__*/React.createElement("svg", _extends$t({
|
|
1612
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1613
|
+
width: 18,
|
|
1614
|
+
height: 18,
|
|
1615
|
+
viewBox: "0 0 18 18",
|
|
1616
|
+
ref: ref
|
|
1617
|
+
}, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
|
|
1618
|
+
fillRule: "evenodd",
|
|
1619
|
+
d: "m9 6-4.5 4.5 1.058 1.057L9 8.123l3.443 3.434L13.5 10.5 9 6z",
|
|
1620
|
+
clipRule: "evenodd"
|
|
1621
|
+
})));
|
|
1622
|
+
};
|
|
1623
|
+
var ForwardRef$t = /*#__PURE__*/forwardRef(SvgNavigationChevronUp18);
|
|
1624
|
+
|
|
1625
|
+
var _path$r;
|
|
1626
|
+
function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
|
|
1627
|
+
var SvgNotificationInfoOutline18 = function SvgNotificationInfoOutline18(props, ref) {
|
|
1628
|
+
return /*#__PURE__*/React.createElement("svg", _extends$s({
|
|
1629
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1630
|
+
width: 18,
|
|
1631
|
+
height: 18,
|
|
1632
|
+
viewBox: "0 0 18 18",
|
|
1633
|
+
ref: ref
|
|
1634
|
+
}, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
|
|
1635
|
+
fillRule: "evenodd",
|
|
1636
|
+
d: "M8 13h2V8H8v5zM9 1C4.584 1 1 4.584 1 9s3.584 8 8 8 8-3.584 8-8-3.584-8-8-8zm0 15c-3.859 0-7-3.141-7-7s3.141-7 7-7 7 3.141 7 7-3.141 7-7 7zM8 7h2V5H8v2z",
|
|
1637
|
+
clipRule: "evenodd"
|
|
1638
|
+
})));
|
|
1639
|
+
};
|
|
1640
|
+
var ForwardRef$s = /*#__PURE__*/forwardRef(SvgNotificationInfoOutline18);
|
|
1641
|
+
|
|
1642
|
+
class DataTableHeaderCell extends React.Component {
|
|
1643
|
+
constructor() {
|
|
1644
|
+
super(...arguments);
|
|
1645
|
+
this.state = {
|
|
1646
|
+
isDropdownOpen: null,
|
|
1647
|
+
};
|
|
1648
|
+
this.getTextStyle = () => {
|
|
1649
|
+
if (this.props.textCase === 'upper')
|
|
1650
|
+
return css$w.upperCase;
|
|
1651
|
+
return css$w['font-size-14'];
|
|
1652
|
+
};
|
|
1653
|
+
this.getColumnCaption = () => (React.createElement("div", { className: css$w.tooltipWrapper },
|
|
1654
|
+
React.createElement(Tooltip, { trigger: "hover", placement: "bottom-start", renderContent: !this.state.isDropdownOpen && this.props.column.info ? () => this.props.column.info : null, color: "default", cx: css$w.cellTooltip, offset: [-12, 12] },
|
|
1655
|
+
React.createElement("div", { className: cx$1(css$w.iconCell, css$w['align-' + this.props.column.textAlign], uuiDataTableHeaderCell.uuiTableHeaderCaptionWrapper) },
|
|
1656
|
+
React.createElement(Text, { key: "text", lineHeight: "30", fontSize: "14", size: "30", cx: cx$1(css$w.caption, this.getTextStyle(), uuiDataTableHeaderCell.uuiTableHeaderCaption) }, this.props.column.caption),
|
|
1657
|
+
this.props.column.info && (React.createElement(IconButton, { key: "info", cx: cx$1(css$w.icon, css$w.infoIcon, this.props.sortDirection && css$w.sortIconActive, uuiDataTableHeaderCell.uuiTableHeaderSortIcon), color: "secondary", icon: ForwardRef$s })),
|
|
1658
|
+
this.props.column.isSortable && (!this.props.column.renderFilter || this.props.sortDirection) && (React.createElement(IconButton, { key: "sort", cx: cx$1(css$w.icon, css$w.sortIcon, this.props.sortDirection && css$w.sortIconActive, uuiDataTableHeaderCell.uuiTableHeaderSortIcon), color: this.props.sortDirection ? 'default' : 'secondary', icon: this.props.sortDirection === 'desc' ? ForwardRef$w : this.props.sortDirection === 'asc' ? ForwardRef$x : ForwardRef$y })),
|
|
1659
|
+
this.props.isFilterActive && (React.createElement(IconButton, { key: "filter", cx: cx$1(css$w.icon, !this.props.sortDirection && css$w.filterIcon, uuiDataTableHeaderCell.uuiTableHeaderFilterIcon), color: "default", icon: ForwardRef$v })),
|
|
1660
|
+
this.props.column.renderFilter && (React.createElement(IconButton, { key: "dropdown", cx: cx$1(css$w.icon, css$w.dropdownIcon, uuiDataTableHeaderCell.uuiTableHeaderDropdownIcon), color: "secondary", icon: this.state.isDropdownOpen ? ForwardRef$t : ForwardRef$u }))))));
|
|
1661
|
+
this.renderHeaderCheckbox = () => this.props.selectAll
|
|
1662
|
+
&& this.props.isFirstColumn && (React.createElement(Checkbox, Object.assign({ size: +this.props.size < 36 ? '12' : '18' }, this.props.selectAll, { cx: cx$1(css$w.checkbox, uuiDataTableHeaderCell.uuiTableHeaderCheckbox) })));
|
|
1663
|
+
this.renderResizeMark = (props) => React.createElement("div", { onMouseDown: props.onResizeStart, className: cx$1(css$w.resizeMark, uuiMarkers.draggable) });
|
|
1664
|
+
this.renderCellContent = (props, dropdownProps) => (React.createElement(FlexCell, Object.assign({}, this.props.column, { minWidth: this.props.column.width, ref: (ref) => {
|
|
1665
|
+
var _a;
|
|
1666
|
+
props.ref(ref);
|
|
1667
|
+
(_a = dropdownProps === null || dropdownProps === void 0 ? void 0 : dropdownProps.ref) === null || _a === void 0 ? void 0 : _a.call(dropdownProps, ref);
|
|
1668
|
+
}, cx: cx$1(uuiDataTableHeaderCell.uuiTableHeaderCell, (this.props.column.isSortable || this.props.isDropdown) && uuiMarkers.clickable, css$w.cell, css$w['size-' + (this.props.size || '36')], this.props.isFirstColumn && css$w['padding-left-24'], this.props.isLastColumn && css$w['padding-right-24'], this.props.column.cx, this.props.allowColumnsResizing && css$w.resizable, props.isDraggable && css$w.draggable, props.isDragGhost && css$w.ghost, props.isDraggedOut && css$w.isDraggedOut, props.isDndInProgress && css$w['dnd-marker-' + props.position]), onClick: !this.props.column.renderFilter ? props.toggleSort : dropdownProps === null || dropdownProps === void 0 ? void 0 : dropdownProps.onClick, rawProps: Object.assign({ role: 'columnheader', 'aria-sort': this.props.sortDirection === 'asc' ? 'ascending' : this.props.sortDirection ? 'descending' : 'none' }, props.eventHandlers) }),
|
|
1669
|
+
this.renderHeaderCheckbox(),
|
|
1670
|
+
this.getColumnCaption(),
|
|
1671
|
+
this.props.allowColumnsResizing && this.renderResizeMark(props)));
|
|
1672
|
+
this.renderCellWithFilter = (props) => (React.createElement(ColumnHeaderDropdown, { isOpen: this.state.isDropdownOpen, isSortable: this.props.column.isSortable, renderTarget: (dropdownProps) => this.renderCellContent(props, dropdownProps), renderFilter: this.props.renderFilter, onSort: this.props.onSort, sortDirection: this.props.sortDirection, onOpenChange: (isDropdownOpen) => this.setState({ isDropdownOpen }), title: this.props.column.caption }));
|
|
1673
|
+
}
|
|
1674
|
+
render() {
|
|
1675
|
+
return React.createElement(DataTableHeaderCell$1, Object.assign({}, this.props, { renderCellContent: this.props.column.renderFilter ? this.renderCellWithFilter : this.renderCellContent }));
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
const useColumnsWithFilters = (initialColumns, filters) => {
|
|
1680
|
+
const makeFilterRenderCallback = useCallback((key) => function (filterLens, dropdownProps) {
|
|
1681
|
+
const filter = filters.find((f) => f.columnKey === key);
|
|
1682
|
+
if (!filter)
|
|
1683
|
+
return null;
|
|
1684
|
+
const props = filterLens.prop(filter.field).toProps();
|
|
1685
|
+
return React__default.createElement(FilterItemBody, Object.assign({}, props, filter, dropdownProps));
|
|
1686
|
+
}, [filters]);
|
|
1687
|
+
const columns = useMemo(() => {
|
|
1688
|
+
if (filters) {
|
|
1689
|
+
const filterKeys = filters.map((f) => f.columnKey);
|
|
1690
|
+
const newColumns = (initialColumns.map((column) => {
|
|
1691
|
+
if (filterKeys.includes(column.key)) {
|
|
1692
|
+
return Object.assign(Object.assign({}, column), { renderFilter: makeFilterRenderCallback(column.key) });
|
|
1693
|
+
}
|
|
1694
|
+
else {
|
|
1695
|
+
return column;
|
|
1696
|
+
}
|
|
1697
|
+
}));
|
|
1698
|
+
return newColumns;
|
|
1699
|
+
}
|
|
1700
|
+
return initialColumns;
|
|
1701
|
+
}, [filters, initialColumns]);
|
|
1702
|
+
return columns;
|
|
1703
|
+
};
|
|
1704
|
+
|
|
1705
|
+
var _path$q, _path2$1, _path3, _path4, _path5, _path6, _g$1, _path7, _path8, _path9, _path10, _path11, _path12, _path13, _path14, _path15, _path16, _path17, _path18, _path19, _path20, _path21, _path22, _path23, _path24, _defs;
|
|
1706
|
+
function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
|
|
1707
|
+
var SvgEmptyTable = function SvgEmptyTable(props, ref) {
|
|
1708
|
+
return /*#__PURE__*/React.createElement("svg", _extends$r({
|
|
1709
|
+
width: 232,
|
|
1710
|
+
height: 180,
|
|
1711
|
+
viewBox: "0 0 232 180",
|
|
1712
|
+
fill: "none",
|
|
1713
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1714
|
+
ref: ref
|
|
1715
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
1716
|
+
clipPath: "url(#a)"
|
|
1717
|
+
}, _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
|
|
1718
|
+
d: "M150.585 1.535C49.483-11.495 27.481 61.805 45.725 97.481c10.581 20.69-39.64 70.792 17.744 81.468 27.538 5.123 36-13.341 62.433-10.655 35.4 3.6 148.167-4.73 88.349-78.915-31.713-39.335 1.026-79.506-63.666-87.844Z",
|
|
1719
|
+
fill: "#F5F6FA"
|
|
1720
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
|
|
1721
|
+
d: "m58.069 136.51-.654 4.238-1.27-5.38a58.934 58.934 0 0 0-11.462-4.965l-.083 5.636-2.545-6.393a55.094 55.094 0 0 0-13.655-1.854l.704 6.178-3.356-6.108c-4.151.183-8.256.946-12.195 2.268l2.33 3.525s-2.173-1.597-4.084-2.896a40.951 40.951 0 0 0-10.833 6.285 85.492 85.492 0 0 0 12.575 10.527c2.482-.637 5.127-1.279 5.127-1.279l-3.261 2.537a69.366 69.366 0 0 0 13.283 6.865c2.346-1.353 5.416-3.269 5.416-3.269l-3.554 3.931a42.226 42.226 0 0 0 15.45 2.359l4.259-4.213-1.697 4.001c7.002-.848 14.144-3.902 20.95-10.344-1.621-3.869-5.768-8.073-11.445-11.649Z",
|
|
1722
|
+
fill: "#9BDEFF"
|
|
1723
|
+
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
1724
|
+
fillRule: "evenodd",
|
|
1725
|
+
clipRule: "evenodd",
|
|
1726
|
+
d: "M.557 136.978a.413.413 0 0 1 .475-.342l68.549 11.118a.414.414 0 0 1-.133.817L.9 137.453a.415.415 0 0 1-.342-.475Z",
|
|
1727
|
+
fill: "#fff"
|
|
1728
|
+
})), _path4 || (_path4 = /*#__PURE__*/React.createElement("path", {
|
|
1729
|
+
d: "M174.887 125.586h-88.1c-2.752 0-5.38-2.234-5.38-4.986V27.534c0-2.752 2.644-4.966 5.38-4.966h88.1c2.752 0 5.4 2.23 5.4 4.966V120.6c0 2.752-2.632 4.986-5.4 4.986Z",
|
|
1730
|
+
fill: "#9BDEFF"
|
|
1731
|
+
})), _path5 || (_path5 = /*#__PURE__*/React.createElement("path", {
|
|
1732
|
+
fillRule: "evenodd",
|
|
1733
|
+
clipRule: "evenodd",
|
|
1734
|
+
d: "M86.786 22.982c-2.55 0-4.965 2.07-4.965 4.552V120.6c0 2.484 2.4 4.572 4.965 4.572h88.101c2.582 0 4.986-2.089 4.986-4.572V27.534c0-2.464-2.418-4.552-4.986-4.552h-88.1Zm-5.793 4.552c0-3.022 2.874-5.38 5.793-5.38h88.101c2.935 0 5.814 2.374 5.814 5.38V120.6c0 3.021-2.86 5.4-5.814 5.4h-88.1c-2.94 0-5.794-2.381-5.794-5.4V27.534Z",
|
|
1735
|
+
fill: "#1D1E26"
|
|
1736
|
+
})), /*#__PURE__*/React.createElement("mask", {
|
|
1737
|
+
id: "b",
|
|
1738
|
+
style: {
|
|
1739
|
+
maskType: "alpha"
|
|
1740
|
+
},
|
|
1741
|
+
maskUnits: "userSpaceOnUse",
|
|
1742
|
+
x: 81,
|
|
1743
|
+
y: 22,
|
|
1744
|
+
width: 100,
|
|
1745
|
+
height: 104
|
|
1746
|
+
}, _path6 || (_path6 = /*#__PURE__*/React.createElement("path", {
|
|
1747
|
+
d: "M174.887 125.586h-88.1c-2.752 0-5.38-2.234-5.38-4.986V27.534c0-2.752 2.644-4.966 5.38-4.966h88.1c2.752 0 5.4 2.23 5.4 4.966V120.6c0 2.752-2.632 4.986-5.4 4.986Z",
|
|
1748
|
+
fill: "#9BDEFF"
|
|
1749
|
+
}))), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
|
|
1750
|
+
mask: "url(#b)",
|
|
1751
|
+
fillRule: "evenodd",
|
|
1752
|
+
clipRule: "evenodd"
|
|
1753
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1754
|
+
d: "M69.817 99.247a.414.414 0 0 1 .585-.003l50.88 50.483a.414.414 0 0 1-.583.588l-50.88-50.483a.414.414 0 0 1-.002-.585ZM72.802 28.407a.414.414 0 0 1 .553.192l63.6 131.172a.413.413 0 1 1-.745.361L72.61 28.96a.414.414 0 0 1 .192-.553Z",
|
|
1755
|
+
fill: "#fff"
|
|
1756
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1757
|
+
d: "M142.576 6.515a.415.415 0 0 1 .087.58L60.185 118.817a.413.413 0 1 1-.665-.491L141.997 6.603a.414.414 0 0 1 .579-.088ZM197.977 60.314c.181.14.214.4.075.58l-76.734 99.311a.414.414 0 0 1-.655-.506l76.734-99.31a.413.413 0 0 1 .58-.075ZM192.316 43.44a.413.413 0 0 1-.103.576L60.089 135.878a.414.414 0 0 1-.473-.68L191.74 43.336a.414.414 0 0 1 .576.104Z",
|
|
1758
|
+
fill: "#fff"
|
|
1759
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1760
|
+
d: "M91.966 11.532a.414.414 0 0 1 .585-.021l129.252 120a.414.414 0 0 1-.563.606l-129.252-120a.414.414 0 0 1-.022-.585ZM75.232 2.769a.414.414 0 0 1 .568.143l93.554 156.828a.414.414 0 1 1-.711.424L75.089 3.336a.414.414 0 0 1 .143-.567ZM125.643.329a.414.414 0 0 1 .584.041l71.81 82.759a.413.413 0 1 1-.625.542L125.602.913a.414.414 0 0 1 .041-.584Z",
|
|
1761
|
+
fill: "#fff"
|
|
1762
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1763
|
+
d: "M67.271 75.369a.414.414 0 0 1 .547-.209l156.745 70.345a.413.413 0 1 1-.339.755L67.479 75.916a.414.414 0 0 1-.208-.547Z",
|
|
1764
|
+
fill: "#fff"
|
|
1765
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1766
|
+
d: "M159.279 8.938a.414.414 0 0 1 .265.522L101.278 187.39a.413.413 0 1 1-.787-.258l58.266-177.93a.414.414 0 0 1 .522-.265Z",
|
|
1767
|
+
fill: "#fff"
|
|
1768
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1769
|
+
d: "M86.786 22.982c-2.55 0-4.965 2.07-4.965 4.552V120.6c0 2.484 2.4 4.572 4.965 4.572h88.101c2.582 0 4.986-2.089 4.986-4.572V27.534c0-2.464-2.418-4.552-4.986-4.552h-88.1Zm-5.793 4.552c0-3.022 2.874-5.38 5.793-5.38h88.101c2.935 0 5.814 2.374 5.814 5.38V120.6c0 3.021-2.86 5.4-5.814 5.4h-88.1c-2.94 0-5.794-2.381-5.794-5.4V27.534Z",
|
|
1770
|
+
fill: "#1D1E26"
|
|
1771
|
+
}))), _path7 || (_path7 = /*#__PURE__*/React.createElement("path", {
|
|
1772
|
+
d: "M180.287 30.828H81.39v-3.724a4.966 4.966 0 0 1 4.966-4.966H175.3a4.963 4.963 0 0 1 4.986 4.965v3.725Z",
|
|
1773
|
+
fill: "#fff"
|
|
1774
|
+
})), _path8 || (_path8 = /*#__PURE__*/React.createElement("path", {
|
|
1775
|
+
fillRule: "evenodd",
|
|
1776
|
+
clipRule: "evenodd",
|
|
1777
|
+
d: "M177.05 22.893a4.548 4.548 0 0 0-1.748-.341H86.356a4.552 4.552 0 0 0-4.552 4.552v3.31h98.069v-3.31a4.55 4.55 0 0 0-2.823-4.211Zm-1.75-1.169a5.375 5.375 0 0 1 4.989 3.316c.272.654.412 1.355.412 2.064v3.724a.414.414 0 0 1-.414.413H81.39a.414.414 0 0 1-.413-.413v-3.724a5.38 5.38 0 0 1 5.379-5.38H175.3Z",
|
|
1778
|
+
fill: "#1D1E26"
|
|
1779
|
+
})), _path9 || (_path9 = /*#__PURE__*/React.createElement("path", {
|
|
1780
|
+
d: "M87.324 28.217a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6ZM93.597 28.217a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6ZM99.866 28.217a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6Z",
|
|
1781
|
+
fill: "#1D1E26"
|
|
1782
|
+
})), _path10 || (_path10 = /*#__PURE__*/React.createElement("path", {
|
|
1783
|
+
d: "M151.71 47.806H63.614a4.986 4.986 0 0 0-4.986 4.986v93.062a4.986 4.986 0 0 0 4.986 4.986h88.096a4.986 4.986 0 0 0 4.987-4.986V52.792a4.987 4.987 0 0 0-4.987-4.986Z",
|
|
1784
|
+
fill: "#fff"
|
|
1785
|
+
})), _path11 || (_path11 = /*#__PURE__*/React.createElement("path", {
|
|
1786
|
+
fillRule: "evenodd",
|
|
1787
|
+
clipRule: "evenodd",
|
|
1788
|
+
d: "M63.614 48.22a4.572 4.572 0 0 0-4.572 4.572v93.062a4.572 4.572 0 0 0 4.572 4.572h88.096a4.572 4.572 0 0 0 4.573-4.572V52.792a4.572 4.572 0 0 0-4.573-4.573H63.614Zm-5.4 4.572a5.4 5.4 0 0 1 5.4-5.4h88.096a5.4 5.4 0 0 1 5.4 5.4v93.062a5.4 5.4 0 0 1-5.4 5.4H63.614a5.4 5.4 0 0 1-5.4-5.4V52.792Z",
|
|
1789
|
+
fill: "#1D1E26"
|
|
1790
|
+
})), _path12 || (_path12 = /*#__PURE__*/React.createElement("path", {
|
|
1791
|
+
d: "M157.11 56.081H58.214v-3.724a4.986 4.986 0 0 1 4.986-4.965h88.924a4.988 4.988 0 0 1 4.986 4.965v3.724Z",
|
|
1792
|
+
fill: "#008ACE"
|
|
1793
|
+
})), _path13 || (_path13 = /*#__PURE__*/React.createElement("path", {
|
|
1794
|
+
d: "M64.566 53.474a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6ZM70.835 53.474a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6ZM77.103 53.474a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6Z",
|
|
1795
|
+
fill: "#1D1E26"
|
|
1796
|
+
})), _path14 || (_path14 = /*#__PURE__*/React.createElement("path", {
|
|
1797
|
+
fillRule: "evenodd",
|
|
1798
|
+
clipRule: "evenodd",
|
|
1799
|
+
d: "M48.968 36.067a.414.414 0 0 1 .585.018l7.005 7.448a.414.414 0 1 1-.603.567l-7.005-7.448a.414.414 0 0 1 .018-.585ZM46.99 44.047a.414.414 0 0 1 .554-.188l6.269 3.104a.414.414 0 0 1-.367.742l-6.27-3.104a.414.414 0 0 1-.187-.554ZM183.97 9.366a.414.414 0 0 1 .213.545l-2.896 6.62a.414.414 0 0 1-.759-.331l2.897-6.621a.414.414 0 0 1 .545-.213ZM192.373 9.866a.415.415 0 0 1 0 .585l-8.276 8.276a.414.414 0 1 1-.585-.585l8.275-8.276a.415.415 0 0 1 .586 0ZM192.464 19.108a.413.413 0 0 1-.23.538l-6.207 2.483a.414.414 0 0 1-.308-.768l6.207-2.483a.414.414 0 0 1 .538.23ZM182.977 54.848c.228 0 .413.185.413.414v58.345a.414.414 0 1 1-.827 0V55.262c0-.229.185-.414.414-.414Z",
|
|
1800
|
+
fill: "#1D1E26"
|
|
1801
|
+
})), _path15 || (_path15 = /*#__PURE__*/React.createElement("path", {
|
|
1802
|
+
d: "M133.371 157.945c23.196 0 42-18.804 42-42s-18.804-42-42-42-42 18.804-42 42 18.804 42 42 42Z",
|
|
1803
|
+
fill: "#008ACE"
|
|
1804
|
+
})), _path16 || (_path16 = /*#__PURE__*/React.createElement("path", {
|
|
1805
|
+
d: "M133.371 149.669c18.625 0 33.724-15.099 33.724-33.724 0-18.625-15.099-33.724-33.724-33.724-18.625 0-33.724 15.099-33.724 33.724 0 18.625 15.099 33.724 33.724 33.724Z",
|
|
1806
|
+
fill: "#fff"
|
|
1807
|
+
})), _path17 || (_path17 = /*#__PURE__*/React.createElement("path", {
|
|
1808
|
+
d: "M117.312 113.565a3.807 3.807 0 1 0 0-7.614 3.807 3.807 0 0 0 0 7.614ZM149.435 113.565a3.806 3.806 0 1 0 0-7.612 3.806 3.806 0 0 0 0 7.612Z",
|
|
1809
|
+
fill: "#1D1E26"
|
|
1810
|
+
})), _path18 || (_path18 = /*#__PURE__*/React.createElement("path", {
|
|
1811
|
+
fillRule: "evenodd",
|
|
1812
|
+
clipRule: "evenodd",
|
|
1813
|
+
d: "M133.38 123.952c-4.592 0-8.525 2.259-10.468 5.423a.827.827 0 1 1-1.41-.866c2.27-3.697 6.762-6.212 11.878-6.212 5.108 0 9.646 2.485 11.882 6.22a.827.827 0 1 1-1.42.85c-1.902-3.176-5.863-5.415-10.462-5.415Z",
|
|
1814
|
+
fill: "#1D1E26"
|
|
1815
|
+
})), _path19 || (_path19 = /*#__PURE__*/React.createElement("path", {
|
|
1816
|
+
d: "m170.965 137.356-7.822 9.777 1.668 1.334 7.822-9.777-1.668-1.334Z",
|
|
1817
|
+
fill: "#1D1E26"
|
|
1818
|
+
})), _path20 || (_path20 = /*#__PURE__*/React.createElement("path", {
|
|
1819
|
+
d: "M200.774 163.345c.579 2.143-3.331 6.852-5.553 6.939-7.035.277-28.73-23.913-28.73-23.913l4.44-5.553s28.122 16.142 29.843 22.527Z",
|
|
1820
|
+
fill: "#9BDEFF"
|
|
1821
|
+
})), _path21 || (_path21 = /*#__PURE__*/React.createElement("path", {
|
|
1822
|
+
d: "M204.424 178.378a6.223 6.223 0 0 0 6.223-6.224 6.224 6.224 0 1 0-6.223 6.224Z",
|
|
1823
|
+
fill: "#9BDEFF"
|
|
1824
|
+
})), _path22 || (_path22 = /*#__PURE__*/React.createElement("path", {
|
|
1825
|
+
d: "M199.586 168.269a6.173 6.173 0 0 1 3.311-2.131l-2.123-1.697c-.464 2.069-2.959 4.995-4.837 5.69l2.296 1.837a6.173 6.173 0 0 1 1.353-3.699Z",
|
|
1826
|
+
fill: "#1D1E26"
|
|
1827
|
+
})), _path23 || (_path23 = /*#__PURE__*/React.createElement("path", {
|
|
1828
|
+
d: "m72.357 138.314-3.5 2.955 2.722-5.317a67.379 67.379 0 0 0-5.958-12.509l-4.014 4.514 2.38-7.076a63.412 63.412 0 0 0-9.932-11.611l-3.724 5.549 1.54-7.448a50.152 50.152 0 0 0-11.628-7.179l-.567 4.605s-.675-2.896-1.333-5.38a44.62 44.62 0 0 0-13.315-2.896 96.722 96.722 0 0 0 2.983 17.856c2.483 1.311 5.119 2.751 5.119 2.751l-4.461-.347a79.474 79.474 0 0 0 6.091 15.385c2.897.637 6.745 1.353 6.745 1.353l-5.677.55c2.871 4.965 6.492 9.6 11.069 13.349l6.45-.269-4.191 1.99c6.356 4.49 14.37 7.3 24.48 7.105 1.398-4.332.902-10.816-1.279-17.93Z",
|
|
1829
|
+
fill: "#008ACE"
|
|
1830
|
+
})), _path24 || (_path24 = /*#__PURE__*/React.createElement("path", {
|
|
1831
|
+
fillRule: "evenodd",
|
|
1832
|
+
clipRule: "evenodd",
|
|
1833
|
+
d: "M24.73 96.184a.414.414 0 0 1 .581.06l48.646 59.751a.413.413 0 1 1-.642.523L24.67 96.766a.414.414 0 0 1 .06-.582Z",
|
|
1834
|
+
fill: "#fff"
|
|
1835
|
+
}))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
1836
|
+
id: "a"
|
|
1837
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1838
|
+
fill: "#fff",
|
|
1839
|
+
transform: "translate(.552)",
|
|
1840
|
+
d: "M0 0h230.897v180H0z"
|
|
1841
|
+
})))));
|
|
1842
|
+
};
|
|
1843
|
+
var ForwardRef$r = /*#__PURE__*/forwardRef(SvgEmptyTable);
|
|
1844
|
+
|
|
1845
|
+
var css$v = {"sticky-header":"DataTable_sticky-header__Dt-br","listContainer":"DataTable_listContainer__MJ2d9","table":"DataTable_table__n--u-","no-results":"DataTable_no-results__8wzS9","no-results-icon":"DataTable_no-results-icon__-nnhq","no-results-title":"DataTable_no-results-title__MM7z0","stickyHeader":"DataTable_sticky-header__Dt-br","noResults":"DataTable_no-results__8wzS9","noResultsIcon":"DataTable_no-results-icon__-nnhq","noResultsTitle":"DataTable_no-results-title__MM7z0"};
|
|
1846
|
+
|
|
1847
|
+
function DataTable(props) {
|
|
1848
|
+
var _a;
|
|
1849
|
+
const { uuiModals } = useUuiContext();
|
|
1850
|
+
const columnsWithFilters = useColumnsWithFilters(props.columns, props.filters);
|
|
1851
|
+
const { columns, config, defaultConfig } = useColumnsConfig(columnsWithFilters, (_a = props.value) === null || _a === void 0 ? void 0 : _a.columnsConfig);
|
|
1852
|
+
const renderRow = React.useCallback((rowProps) => {
|
|
1853
|
+
return React.createElement(DataTableRow, Object.assign({ key: rowProps.rowKey, size: props.size, borderBottom: props.border }, rowProps));
|
|
1854
|
+
}, []);
|
|
1855
|
+
const rows = props.getRows();
|
|
1856
|
+
const renderedRows = rows.map((row) => (props.renderRow || renderRow)(Object.assign(Object.assign({}, row), { columns })));
|
|
1857
|
+
const renderNoResultsBlock = React.useCallback(() => {
|
|
1858
|
+
var _a;
|
|
1859
|
+
return (React.createElement("div", { className: css$v.noResults }, props.renderNoResultsBlock ? ((_a = props.renderNoResultsBlock) === null || _a === void 0 ? void 0 : _a.call(props)) : (React.createElement(React.Fragment, null,
|
|
1860
|
+
React.createElement(IconContainer, { cx: css$v.noResultsIcon, icon: ForwardRef$r }),
|
|
1861
|
+
React.createElement(Text, { cx: css$v.noResultsTitle, fontSize: "24", lineHeight: "30", color: "primary", font: "semibold" }, i18n.tables.noResultsBlock.title),
|
|
1862
|
+
React.createElement(Text, { fontSize: "16", lineHeight: "24", font: "regular", color: "primary" }, i18n.tables.noResultsBlock.message)))));
|
|
1863
|
+
}, [props.renderNoResultsBlock]);
|
|
1864
|
+
const onConfigurationButtonClick = React.useCallback(() => {
|
|
1865
|
+
uuiModals
|
|
1866
|
+
.show((modalProps) => {
|
|
1867
|
+
return (React.createElement(ColumnsConfigurationModal, Object.assign({}, modalProps, { columns: props.columns, columnsConfig: config, defaultConfig: defaultConfig })));
|
|
1868
|
+
})
|
|
1869
|
+
.then((columnsConfig) => props.onValueChange(Object.assign(Object.assign({}, props.value), { columnsConfig })))
|
|
1870
|
+
.catch(() => null);
|
|
1871
|
+
}, [
|
|
1872
|
+
props.columns, config, defaultConfig, props.value, props.onValueChange,
|
|
1873
|
+
]);
|
|
1874
|
+
const renderRowsContainer = React.useCallback(({ listContainerRef, estimatedHeight, offsetY, scrollShadows, }) => (React.createElement(React.Fragment, null,
|
|
1875
|
+
React.createElement("div", { className: css$v.stickyHeader },
|
|
1876
|
+
React.createElement(DataTableHeaderRow, { columns: columns, onConfigButtonClick: props.showColumnsConfig && onConfigurationButtonClick, selectAll: props.selectAll, size: props.size, textCase: props.headerTextCase, allowColumnsReordering: props.allowColumnsReordering, allowColumnsResizing: props.allowColumnsResizing, value: props.value, onValueChange: props.onValueChange }),
|
|
1877
|
+
React.createElement("div", { className: cx$1(uuiScrollShadows.top, {
|
|
1878
|
+
[uuiScrollShadows.topVisible]: scrollShadows.verticalTop,
|
|
1879
|
+
}) })),
|
|
1880
|
+
props.exactRowsCount !== 0 ? (React.createElement("div", { className: css$v.listContainer, style: { minHeight: `${estimatedHeight}px` } },
|
|
1881
|
+
React.createElement("div", { ref: listContainerRef, role: "rowgroup", style: { marginTop: offsetY }, children: renderedRows }))) : (renderNoResultsBlock === null || renderNoResultsBlock === void 0 ? void 0 : renderNoResultsBlock()))), [
|
|
1882
|
+
props, columns, rows, renderNoResultsBlock, onConfigurationButtonClick,
|
|
1883
|
+
]);
|
|
1884
|
+
return (React.createElement(DataTableSelectionProvider, { onCopy: props.onCopy, rows: rows, columns: columns },
|
|
1885
|
+
React.createElement(VirtualList, { value: props.value, onValueChange: props.onValueChange, onScroll: props.onScroll, rows: renderedRows, rowsCount: props.rowsCount, renderRows: renderRowsContainer, cx: cx$1(css$v.table), rawProps: {
|
|
1886
|
+
role: 'table',
|
|
1887
|
+
'aria-colcount': columns.length,
|
|
1888
|
+
'aria-rowcount': props.rowsCount,
|
|
1889
|
+
} })));
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
var styles$1 = {"typography-header":"ColumnsConfigurationModal_typography-header__o3r5C","typography-block":"ColumnsConfigurationModal_typography-block__CXaTR","typography-inline":"ColumnsConfigurationModal_typography-inline__VJCzZ","typography-16":"ColumnsConfigurationModal_typography-16__97zzl","typography-14":"ColumnsConfigurationModal_typography-14__tVuMI","typography-12":"ColumnsConfigurationModal_typography-12__-4gpA","typography-promo":"ColumnsConfigurationModal_typography-promo__5VMFg ColumnsConfigurationModal_typography-header__o3r5C ColumnsConfigurationModal_typography-block__CXaTR ColumnsConfigurationModal_typography-inline__VJCzZ","main-panel":"ColumnsConfigurationModal_main-panel__hCrXd","group-title":"ColumnsConfigurationModal_group-title__UtJIu","group-title-text":"ColumnsConfigurationModal_group-title-text__3hOPf","group-title-badge":"ColumnsConfigurationModal_group-title-badge__4agZV","group-items":"ColumnsConfigurationModal_group-items__g1FUY","no-data":"ColumnsConfigurationModal_no-data__CzFcf","h-divider":"ColumnsConfigurationModal_h-divider__W9MsK","search-area":"ColumnsConfigurationModal_search-area__FGWyb","typographyHeader":"ColumnsConfigurationModal_typography-header__o3r5C","typographyBlock":"ColumnsConfigurationModal_typography-block__CXaTR","typographyInline":"ColumnsConfigurationModal_typography-inline__VJCzZ","typography16":"ColumnsConfigurationModal_typography-16__97zzl","typography14":"ColumnsConfigurationModal_typography-14__tVuMI","typography12":"ColumnsConfigurationModal_typography-12__-4gpA","typographyPromo":"ColumnsConfigurationModal_typography-promo__5VMFg ColumnsConfigurationModal_typography-header__o3r5C ColumnsConfigurationModal_typography-block__CXaTR ColumnsConfigurationModal_typography-inline__VJCzZ","mainPanel":"ColumnsConfigurationModal_main-panel__hCrXd","groupTitle":"ColumnsConfigurationModal_group-title__UtJIu","groupTitleText":"ColumnsConfigurationModal_group-title-text__3hOPf","groupTitleBadge":"ColumnsConfigurationModal_group-title-badge__4agZV","groupItems":"ColumnsConfigurationModal_group-items__g1FUY","noData":"ColumnsConfigurationModal_no-data__CzFcf","hDivider":"ColumnsConfigurationModal_h-divider__W9MsK","searchArea":"ColumnsConfigurationModal_search-area__FGWyb"};
|
|
1893
|
+
|
|
1894
|
+
var _path$p;
|
|
1895
|
+
function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
|
|
1896
|
+
var SvgNavigationMoreVert18 = function SvgNavigationMoreVert18(props, ref) {
|
|
1897
|
+
return /*#__PURE__*/React.createElement("svg", _extends$q({
|
|
1898
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1899
|
+
width: 18,
|
|
1900
|
+
height: 18,
|
|
1901
|
+
viewBox: "0 0 18 18",
|
|
1902
|
+
ref: ref
|
|
1903
|
+
}, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
|
|
1904
|
+
fillRule: "evenodd",
|
|
1905
|
+
d: "M9 6c.825 0 1.5-.675 1.5-1.5S9.825 3 9 3s-1.5.675-1.5 1.5S8.175 6 9 6zm0 1.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5 1.5-.675 1.5-1.5S9.825 7.5 9 7.5zM9 12c-.825 0-1.5.675-1.5 1.5S8.175 15 9 15s1.5-.675 1.5-1.5S9.825 12 9 12z",
|
|
1906
|
+
clipRule: "evenodd"
|
|
1907
|
+
})));
|
|
1908
|
+
};
|
|
1909
|
+
var ForwardRef$q = /*#__PURE__*/forwardRef(SvgNavigationMoreVert18);
|
|
1910
|
+
|
|
1911
|
+
var _path$o;
|
|
1912
|
+
function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
|
|
1913
|
+
var SvgActionUpdate18 = function SvgActionUpdate18(props, ref) {
|
|
1914
|
+
return /*#__PURE__*/React.createElement("svg", _extends$p({
|
|
1915
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1916
|
+
width: 18,
|
|
1917
|
+
height: 18,
|
|
1918
|
+
viewBox: "0 0 18 18",
|
|
1919
|
+
ref: ref
|
|
1920
|
+
}, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
|
|
1921
|
+
fillRule: "evenodd",
|
|
1922
|
+
d: "M8.007 2A7.004 7.004 0 0 0 1 9a7.004 7.004 0 0 0 11.732 5.16l-1.497-1.347A4.999 4.999 0 0 1 3 9c0-2.763 2.237-5 5-5 2.762 0 5 2.237 5 5h2c0-3.864-3.129-7-6.993-7zM11 9l3 3 3-3h-6z",
|
|
1923
|
+
clipRule: "evenodd"
|
|
1924
|
+
})));
|
|
1925
|
+
};
|
|
1926
|
+
var ForwardRef$p = /*#__PURE__*/forwardRef(SvgActionUpdate18);
|
|
1927
|
+
|
|
1928
|
+
var _path$n;
|
|
1929
|
+
function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
|
|
1930
|
+
var SvgActionLockFill18 = function SvgActionLockFill18(props, ref) {
|
|
1931
|
+
return /*#__PURE__*/React.createElement("svg", _extends$o({
|
|
1932
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1933
|
+
width: 18,
|
|
1934
|
+
height: 18,
|
|
1935
|
+
viewBox: "0 0 18 18",
|
|
1936
|
+
ref: ref
|
|
1937
|
+
}, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
|
|
1938
|
+
fillRule: "evenodd",
|
|
1939
|
+
d: "M5 7V5a4 4 0 1 1 8 0v2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2zm2 0h4V5a2 2 0 1 0-4 0v2zm2 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",
|
|
1940
|
+
clipRule: "evenodd"
|
|
1941
|
+
})));
|
|
1942
|
+
};
|
|
1943
|
+
var ForwardRef$o = /*#__PURE__*/forwardRef(SvgActionLockFill18);
|
|
1944
|
+
|
|
1945
|
+
var _path$m;
|
|
1946
|
+
function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
|
|
1947
|
+
var SvgActionPinOn18 = function SvgActionPinOn18(props, ref) {
|
|
1948
|
+
return /*#__PURE__*/React.createElement("svg", _extends$n({
|
|
1949
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1950
|
+
width: 18,
|
|
1951
|
+
height: 18,
|
|
1952
|
+
viewBox: "0 0 18 18",
|
|
1953
|
+
ref: ref
|
|
1954
|
+
}, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
|
|
1955
|
+
fillRule: "evenodd",
|
|
1956
|
+
d: "M12 9V3h1V2H5v1h1v6l-2 1v1h4v5h2v-5h4v-1l-2-1z",
|
|
1957
|
+
clipRule: "evenodd"
|
|
1958
|
+
})));
|
|
1959
|
+
};
|
|
1960
|
+
var ForwardRef$n = /*#__PURE__*/forwardRef(SvgActionPinOn18);
|
|
1961
|
+
|
|
1962
|
+
var _path$l;
|
|
1963
|
+
function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
|
|
1964
|
+
var SvgActionPinOff18 = function SvgActionPinOff18(props, ref) {
|
|
1965
|
+
return /*#__PURE__*/React.createElement("svg", _extends$m({
|
|
1966
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1967
|
+
width: 18,
|
|
1968
|
+
height: 18,
|
|
1969
|
+
viewBox: "0 0 18 18",
|
|
1970
|
+
ref: ref
|
|
1971
|
+
}, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
|
|
1972
|
+
d: "M6 4.586 12.414 11H14v-1l-2-1V3h1V2H5v1h1v1.586zM10 16v-4.586l3.743 3.743.707-.707L3.136 3.136l-.707.707L6 7.414V9l-2 1v1h4v5h2z"
|
|
1973
|
+
})));
|
|
1974
|
+
};
|
|
1975
|
+
var ForwardRef$m = /*#__PURE__*/forwardRef(SvgActionPinOff18);
|
|
1976
|
+
|
|
1977
|
+
const i18nLocal$1 = i18n.tables.columnsConfigurationModal;
|
|
1978
|
+
function PinIconButton(props) {
|
|
1979
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
1980
|
+
const { id, onTogglePin, isPinned, canUnpin, } = props;
|
|
1981
|
+
const isPinnedAlways = isPinned && !canUnpin;
|
|
1982
|
+
const tooltipText = useMemo(() => {
|
|
1983
|
+
if (isPinned) {
|
|
1984
|
+
return isPinnedAlways ? i18nLocal$1.lockedColumnPinButton : i18nLocal$1.unPinColumnButton;
|
|
1985
|
+
}
|
|
1986
|
+
return i18nLocal$1.pinColumnButton;
|
|
1987
|
+
}, [isPinned, isPinnedAlways]);
|
|
1988
|
+
const pinIcon = useMemo(() => {
|
|
1989
|
+
if (isPinnedAlways) {
|
|
1990
|
+
return ForwardRef$o;
|
|
1991
|
+
}
|
|
1992
|
+
if (isPinned) {
|
|
1993
|
+
return isHovered ? ForwardRef$m : ForwardRef$n;
|
|
1994
|
+
}
|
|
1995
|
+
return ForwardRef$n;
|
|
1996
|
+
}, [
|
|
1997
|
+
isPinnedAlways, isHovered, isPinned,
|
|
1998
|
+
]);
|
|
1999
|
+
const pinClickHandler = isPinnedAlways ? undefined : () => onTogglePin(id);
|
|
2000
|
+
return (React.createElement("span", { onMouseOver: () => setIsHovered(true), onMouseOut: () => setIsHovered(false) },
|
|
2001
|
+
React.createElement(Tooltip, { content: tooltipText, placement: "bottom", color: "contrast" },
|
|
2002
|
+
React.createElement(IconButton, { icon: pinIcon, onClick: pinClickHandler, isDisabled: isPinnedAlways, color: isPinned ? 'info' : undefined }))));
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
var styles = {"typography-header":"ColumnRow_typography-header__v5iBP","typography-block":"ColumnRow_typography-block__PpJOb","typography-inline":"ColumnRow_typography-inline__GYRwx","typography-16":"ColumnRow_typography-16__4CRKd","typography-14":"ColumnRow_typography-14__xizHg","typography-12":"ColumnRow_typography-12__Cr5Gv","typography-promo":"ColumnRow_typography-promo__ea8Ex ColumnRow_typography-header__v5iBP ColumnRow_typography-block__PpJOb ColumnRow_typography-inline__GYRwx","row-wrapper":"ColumnRow_row-wrapper__XJiWz","not-pinned":"ColumnRow_not-pinned__I-gDy","pin-icon-button":"ColumnRow_pin-icon-button__YTlTW","drag-handle":"ColumnRow_drag-handle__S4faK","dnd-disabled":"ColumnRow_dnd-disabled__HqbOB","typographyHeader":"ColumnRow_typography-header__v5iBP","typographyBlock":"ColumnRow_typography-block__PpJOb","typographyInline":"ColumnRow_typography-inline__GYRwx","typography16":"ColumnRow_typography-16__4CRKd","typography14":"ColumnRow_typography-14__xizHg","typography12":"ColumnRow_typography-12__Cr5Gv","typographyPromo":"ColumnRow_typography-promo__ea8Ex ColumnRow_typography-header__v5iBP ColumnRow_typography-block__PpJOb ColumnRow_typography-inline__GYRwx","rowWrapper":"ColumnRow_row-wrapper__XJiWz","notPinned":"ColumnRow_not-pinned__I-gDy","pinIconButton":"ColumnRow_pin-icon-button__YTlTW","dragHandle":"ColumnRow_drag-handle__S4faK","dndDisabled":"ColumnRow_dnd-disabled__HqbOB"};
|
|
2006
|
+
|
|
2007
|
+
const ColumnRow = React.memo(function ColumnRow(props) {
|
|
2008
|
+
const { column } = props;
|
|
2009
|
+
const { toggleVisibility, togglePin, onCanAcceptDrop, onDrop, columnConfig, isDndAllowed, isPinnedAlways, } = column;
|
|
2010
|
+
const { isVisible, fix } = columnConfig;
|
|
2011
|
+
const isPinned = fix || isPinnedAlways;
|
|
2012
|
+
const data = { column, columnConfig };
|
|
2013
|
+
const renderContent = (dndActorParams) => {
|
|
2014
|
+
const wrapperClasses = cx$1(styles.rowWrapper, !isPinned && styles.notPinned, ...(isDndAllowed ? dndActorParams.classNames : []));
|
|
2015
|
+
const _a = dndActorParams.eventHandlers, { onTouchStart, onPointerDown } = _a, restEventHandlers = __rest(_a, ["onTouchStart", "onPointerDown"]);
|
|
2016
|
+
const wrapperAttrs = Object.assign(Object.assign({}, (isDndAllowed ? { ref: dndActorParams.ref } : {})), (isDndAllowed ? { rawProps: Object.assign({}, restEventHandlers) } : {}));
|
|
2017
|
+
const dragHandleRawProps = Object.assign({}, (isDndAllowed ? { onTouchStart, onPointerDown } : {}));
|
|
2018
|
+
return (React.createElement(FlexRow, Object.assign({ size: "30", cx: wrapperClasses }, wrapperAttrs),
|
|
2019
|
+
React.createElement(FlexRow, { size: "30", spacing: "6", cx: styles.title },
|
|
2020
|
+
React.createElement(DragHandle, { rawProps: dragHandleRawProps, isDisabled: !isDndAllowed, cx: cx$1(styles.dragHandle, !isDndAllowed && styles.dndDisabled) }),
|
|
2021
|
+
React.createElement(Checkbox, { key: column.key, label: column.caption, value: isVisible, onValueChange: toggleVisibility, isDisabled: column.isAlwaysVisible })),
|
|
2022
|
+
React.createElement(FlexSpacer, null),
|
|
2023
|
+
React.createElement(FlexRow, { size: "30", cx: styles.pinIconButton },
|
|
2024
|
+
React.createElement(PinIconButton, { id: column.key, isPinned: !!isPinned, canUnpin: !isPinnedAlways, onTogglePin: togglePin })),
|
|
2025
|
+
React.createElement(DropMarker, Object.assign({}, dndActorParams))));
|
|
2026
|
+
};
|
|
2027
|
+
return (React.createElement(DndActor, { key: column.key, srcData: data, dstData: data, canAcceptDrop: onCanAcceptDrop, onDrop: onDrop, render: renderContent }));
|
|
2028
|
+
});
|
|
2029
|
+
|
|
2030
|
+
const i18nLocal = i18n.tables.columnsConfigurationModal;
|
|
2031
|
+
const renderGroupTitle = (title, amount) => (React.createElement(FlexRow, { size: "24", padding: "24", spacing: "6", cx: styles$1.groupTitle },
|
|
2032
|
+
React.createElement(Text, { cx: styles$1.groupTitleText, font: "semibold", lineHeight: "24", fontSize: "14" }, title),
|
|
2033
|
+
React.createElement(Badge, { cx: styles$1.groupTitleBadge, caption: amount, color: "info", size: "18" })));
|
|
2034
|
+
function ColumnsConfigurationModal(props) {
|
|
2035
|
+
const { columns, columnsConfig: initialColumnsConfig, defaultConfig } = props, modalProps = __rest(props, ["columns", "columnsConfig", "defaultConfig"]);
|
|
2036
|
+
const { groupedColumns, searchValue, columnsConfig, reset, checkAll, uncheckAll, setSearchValue, } = useColumnsConfiguration({
|
|
2037
|
+
initialColumnsConfig,
|
|
2038
|
+
columns,
|
|
2039
|
+
defaultConfig,
|
|
2040
|
+
});
|
|
2041
|
+
const apply = useCallback(() => modalProps.success(columnsConfig), [columnsConfig, modalProps]);
|
|
2042
|
+
const close = useCallback(() => modalProps.abort(), [modalProps]);
|
|
2043
|
+
const isNoData = useMemo(() => Object.values(groupedColumns).every((v) => !v.length), [groupedColumns]);
|
|
2044
|
+
const renderVisible = () => {
|
|
2045
|
+
const amountPinned = groupedColumns.displayedPinned.length;
|
|
2046
|
+
const amountUnPinned = groupedColumns.displayedUnpinned.length;
|
|
2047
|
+
if (!amountPinned && !amountUnPinned) {
|
|
2048
|
+
return null;
|
|
2049
|
+
}
|
|
2050
|
+
const hasDivider = !!(amountPinned && amountUnPinned);
|
|
2051
|
+
return (React.createElement(React.Fragment, null,
|
|
2052
|
+
renderGroupTitle(i18nLocal.displayedSectionTitle, amountPinned + amountUnPinned),
|
|
2053
|
+
!!amountPinned && (React.createElement(FlexRow, { cx: styles$1.groupItems, size: "30" }, groupedColumns.displayedPinned.map((c) => (React.createElement(ColumnRow, { column: c, key: c.key }))))),
|
|
2054
|
+
hasDivider && React.createElement("div", { className: styles$1.hDivider }),
|
|
2055
|
+
!!amountUnPinned && (React.createElement(FlexRow, { cx: styles$1.groupItems, size: "30" }, groupedColumns.displayedUnpinned.map((c) => (React.createElement(ColumnRow, { column: c, key: c.key })))))));
|
|
2056
|
+
};
|
|
2057
|
+
const renderHidden = () => {
|
|
2058
|
+
const amountHidden = groupedColumns.hidden.length;
|
|
2059
|
+
if (!amountHidden) {
|
|
2060
|
+
return null;
|
|
2061
|
+
}
|
|
2062
|
+
return (React.createElement(React.Fragment, null,
|
|
2063
|
+
renderGroupTitle(i18nLocal.hiddenSectionTitle, amountHidden),
|
|
2064
|
+
React.createElement(FlexRow, { cx: styles$1.groupItems, size: "30" }, groupedColumns.hidden.map((c) => (React.createElement(ColumnRow, { column: c, key: c.key }))))));
|
|
2065
|
+
};
|
|
2066
|
+
const noVisibleColumns = useMemo(() => !groupedColumns.displayedPinned.length && !groupedColumns.displayedUnpinned.length, [groupedColumns.displayedPinned, groupedColumns.displayedUnpinned]);
|
|
2067
|
+
const applyButton = React.createElement(Button, { caption: i18nLocal.applyButton, isDisabled: noVisibleColumns, color: "accent", onClick: apply });
|
|
2068
|
+
return (React.createElement(ModalBlocker, Object.assign({}, modalProps),
|
|
2069
|
+
React.createElement(ModalWindow, { height: 700 },
|
|
2070
|
+
React.createElement(ModalHeader, { title: i18nLocal.configureColumnsTitle, onClose: close }),
|
|
2071
|
+
React.createElement(FlexRow, { padding: "24", borderBottom: true, spacing: "12", cx: styles$1.searchArea },
|
|
2072
|
+
React.createElement(SearchInput, { size: "30", value: searchValue, onValueChange: setSearchValue, placeholder: i18nLocal.searchPlaceholder }),
|
|
2073
|
+
React.createElement(Dropdown, { closeOnTargetClick: true, renderBody: () => (React.createElement(Panel, { shadow: true },
|
|
2074
|
+
React.createElement(DropdownMenuButton, { caption: i18nLocal.clearAllButton, onClick: uncheckAll }),
|
|
2075
|
+
React.createElement(DropdownMenuButton, { caption: i18nLocal.selectAllButton, onClick: checkAll }))), renderTarget: (props) => React.createElement(Button, Object.assign({}, props, { mode: "none", icon: ForwardRef$q, size: "30", color: "secondary", isDropdown: false })) })),
|
|
2076
|
+
React.createElement(Panel, { cx: styles$1.mainPanel },
|
|
2077
|
+
React.createElement(ScrollBars, null,
|
|
2078
|
+
renderVisible(),
|
|
2079
|
+
renderHidden(),
|
|
2080
|
+
isNoData && (React.createElement(FlexRow, { cx: styles$1.noData },
|
|
2081
|
+
React.createElement(Text, { fontSize: "24", lineHeight: "30", color: "primary", font: "semibold" }, i18nLocal.noResultsFound.text),
|
|
2082
|
+
React.createElement(Text, { fontSize: "16", lineHeight: "24", font: "regular", color: "primary" }, i18nLocal.noResultsFound.subText))))),
|
|
2083
|
+
React.createElement(ModalFooter, { borderTop: true },
|
|
2084
|
+
React.createElement(LinkButton, { icon: ForwardRef$p, caption: i18nLocal.resetToDefaultButton, onClick: reset }),
|
|
2085
|
+
React.createElement(FlexSpacer, null),
|
|
2086
|
+
React.createElement(Button, { mode: "ghost", color: "secondary", caption: i18nLocal.cancelButton, onClick: close }),
|
|
2087
|
+
noVisibleColumns ? (React.createElement(Tooltip, { content: i18nLocal.enableAtLeastOneColumnMessage, placement: "top-end", color: "critical" }, applyButton)) : (applyButton)))));
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
var css$u = {"panel":"ColumnHeaderDropdown_panel__52aQo"};
|
|
2091
|
+
|
|
2092
|
+
var css$t = {"typography-header":"SortingPanel_typography-header__xME1m","typography-block":"SortingPanel_typography-block__YDYpy","typography-inline":"SortingPanel_typography-inline__Tcu9M","typography-16":"SortingPanel_typography-16__63gUO","typography-14":"SortingPanel_typography-14__fFFKh","typography-12":"SortingPanel_typography-12__gbS0m","typography-promo":"SortingPanel_typography-promo__Ng4h4 SortingPanel_typography-header__xME1m SortingPanel_typography-block__YDYpy SortingPanel_typography-inline__Tcu9M","sorting-panel-container":"SortingPanel_sorting-panel-container__DH1x6","sort-active":"SortingPanel_sort-active__KNhjc","typographyHeader":"SortingPanel_typography-header__xME1m","typographyBlock":"SortingPanel_typography-block__YDYpy","typographyInline":"SortingPanel_typography-inline__Tcu9M","typography16":"SortingPanel_typography-16__63gUO","typography14":"SortingPanel_typography-14__fFFKh","typography12":"SortingPanel_typography-12__gbS0m","typographyPromo":"SortingPanel_typography-promo__Ng4h4 SortingPanel_typography-header__xME1m SortingPanel_typography-block__YDYpy SortingPanel_typography-inline__Tcu9M","sortingPanelContainer":"SortingPanel_sorting-panel-container__DH1x6","sortActive":"SortingPanel_sort-active__KNhjc"};
|
|
2093
|
+
|
|
2094
|
+
const SortingPanelImpl = ({ sortDirection, onSort }) => {
|
|
2095
|
+
const sortAsc = useCallback(() => onSort(sortDirection === 'asc' ? undefined : 'asc'), [onSort]);
|
|
2096
|
+
const sortDesc = useCallback(() => onSort(sortDirection === 'desc' ? undefined : 'desc'), [onSort]);
|
|
2097
|
+
return (React__default.createElement(FlexCell, { cx: css$t.sortingPanelContainer },
|
|
2098
|
+
React__default.createElement(DropdownMenuButton, { isActive: sortDirection === 'asc', caption: i18n.pickerFilterHeader.sortAscending, icon: ForwardRef$x, onClick: sortAsc }),
|
|
2099
|
+
React__default.createElement(DropdownMenuButton, { isActive: sortDirection === 'desc', caption: i18n.pickerFilterHeader.sortDescending, icon: ForwardRef$w, onClick: sortDesc })));
|
|
2100
|
+
};
|
|
2101
|
+
const SortingPanel = React__default.memo(SortingPanelImpl);
|
|
2102
|
+
|
|
2103
|
+
const ColumnHeaderDropdownImpl = (props) => {
|
|
2104
|
+
const popperModifiers = useMemo(() => [
|
|
2105
|
+
{
|
|
2106
|
+
name: 'offset',
|
|
2107
|
+
options: { offset: [0, 1] },
|
|
2108
|
+
}, mobilePopperModifier,
|
|
2109
|
+
], []);
|
|
2110
|
+
const style = useMemo(() => ({
|
|
2111
|
+
width: isMobile() ? document.documentElement.clientWidth : undefined,
|
|
2112
|
+
}), []);
|
|
2113
|
+
const closeDropdown = useCallback(() => props.onOpenChange(false), [props.onOpenChange]);
|
|
2114
|
+
return (React__default.createElement(Dropdown$1, { renderTarget: props.renderTarget, renderBody: (dropdownProps) => (React__default.createElement(Panel, { style: style, shadow: true, cx: css$u.panel },
|
|
2115
|
+
React__default.createElement(MobileDropdownWrapper, { title: props.title, close: closeDropdown },
|
|
2116
|
+
props.isSortable && React__default.createElement(SortingPanel, { sortDirection: props.sortDirection, onSort: props.onSort }),
|
|
2117
|
+
props.renderFilter(dropdownProps)))), modifiers: popperModifiers, value: props.isOpen, onValueChange: props.onOpenChange }));
|
|
2118
|
+
};
|
|
2119
|
+
const ColumnHeaderDropdown = React__default.memo(ColumnHeaderDropdownImpl);
|
|
2120
|
+
|
|
2121
|
+
var _path$k;
|
|
2122
|
+
function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
|
|
2123
|
+
var SvgNotificationDone24 = function SvgNotificationDone24(props, ref) {
|
|
2124
|
+
return /*#__PURE__*/React.createElement("svg", _extends$l({
|
|
2125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2126
|
+
width: 24,
|
|
2127
|
+
height: 24,
|
|
2128
|
+
viewBox: "0 0 24 24",
|
|
2129
|
+
ref: ref
|
|
2130
|
+
}, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
|
|
2131
|
+
fillRule: "evenodd",
|
|
2132
|
+
d: "m9.727 16.075-4.295-4.388L4 13.149 9.727 19 22 6.463 20.568 5 9.728 16.075z",
|
|
2133
|
+
clipRule: "evenodd"
|
|
2134
|
+
})));
|
|
2135
|
+
};
|
|
2136
|
+
var ForwardRef$l = /*#__PURE__*/forwardRef(SvgNotificationDone24);
|
|
2137
|
+
|
|
2138
|
+
var _path$j;
|
|
2139
|
+
function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
|
|
2140
|
+
var SvgNotificationDone18 = function SvgNotificationDone18(props, ref) {
|
|
2141
|
+
return /*#__PURE__*/React.createElement("svg", _extends$k({
|
|
2142
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2143
|
+
width: 18,
|
|
2144
|
+
height: 18,
|
|
2145
|
+
viewBox: "0 0 18 18",
|
|
2146
|
+
ref: ref
|
|
2147
|
+
}, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
|
|
2148
|
+
fillRule: "evenodd",
|
|
2149
|
+
d: "M7.136 11.91 4.034 8.776 3 9.821 7.136 14 16 5.045 14.966 4l-7.83 7.91z",
|
|
2150
|
+
clipRule: "evenodd"
|
|
2151
|
+
})));
|
|
2152
|
+
};
|
|
2153
|
+
var ForwardRef$k = /*#__PURE__*/forwardRef(SvgNotificationDone18);
|
|
2154
|
+
|
|
2155
|
+
var _path$i;
|
|
2156
|
+
function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
|
|
2157
|
+
var SvgNotificationDone12 = function SvgNotificationDone12(props, ref) {
|
|
2158
|
+
return /*#__PURE__*/React.createElement("svg", _extends$j({
|
|
2159
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2160
|
+
width: 12,
|
|
2161
|
+
height: 12,
|
|
2162
|
+
viewBox: "0 0 12 12",
|
|
2163
|
+
ref: ref
|
|
2164
|
+
}, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
|
|
2165
|
+
d: "M11 3.6 9.462 2 4.846 6.8 2.538 4.4 1 6l3.846 4L11 3.6z"
|
|
2166
|
+
})));
|
|
2167
|
+
};
|
|
2168
|
+
var ForwardRef$j = /*#__PURE__*/forwardRef(SvgNotificationDone12);
|
|
2169
|
+
|
|
2170
|
+
var css$s = {"typography-header":"DataPickerRow_typography-header__IfaEa","typography-block":"DataPickerRow_typography-block__h7PJR","typography-inline":"DataPickerRow_typography-inline__nLffn","typography-16":"DataPickerRow_typography-16__d2vFn","typography-14":"DataPickerRow_typography-14__lhGfr","typography-12":"DataPickerRow_typography-12__jpyOF","typography-promo":"DataPickerRow_typography-promo__XThFP DataPickerRow_typography-header__IfaEa DataPickerRow_typography-block__h7PJR DataPickerRow_typography-inline__nLffn","render-item":"DataPickerRow_render-item__YsRTQ","icon-wrapper":"DataPickerRow_icon-wrapper__Pwg6e","picker-row":"DataPickerRow_picker-row__yZk93","icon-default":"DataPickerRow_icon-default__DpPlP","icon-primary":"DataPickerRow_icon-primary__s8KHw","typographyHeader":"DataPickerRow_typography-header__IfaEa","typographyBlock":"DataPickerRow_typography-block__h7PJR","typographyInline":"DataPickerRow_typography-inline__nLffn","typography16":"DataPickerRow_typography-16__d2vFn","typography14":"DataPickerRow_typography-14__lhGfr","typography12":"DataPickerRow_typography-12__jpyOF","typographyPromo":"DataPickerRow_typography-promo__XThFP DataPickerRow_typography-header__IfaEa DataPickerRow_typography-block__h7PJR DataPickerRow_typography-inline__nLffn","renderItem":"DataPickerRow_render-item__YsRTQ","iconWrapper":"DataPickerRow_icon-wrapper__Pwg6e","pickerRow":"DataPickerRow_picker-row__yZk93","iconDefault":"DataPickerRow_icon-default__DpPlP","iconPrimary":"DataPickerRow_icon-primary__s8KHw"};
|
|
2171
|
+
|
|
2172
|
+
class DataPickerRow extends React.Component {
|
|
2173
|
+
constructor() {
|
|
2174
|
+
super(...arguments);
|
|
2175
|
+
this.getIcon = (size) => {
|
|
2176
|
+
switch (size) {
|
|
2177
|
+
case '24':
|
|
2178
|
+
return ForwardRef$j;
|
|
2179
|
+
case '30':
|
|
2180
|
+
return ForwardRef$k;
|
|
2181
|
+
case '36':
|
|
2182
|
+
return ForwardRef$k;
|
|
2183
|
+
case '42':
|
|
2184
|
+
return ForwardRef$l;
|
|
2185
|
+
default:
|
|
2186
|
+
return ForwardRef$k;
|
|
2187
|
+
}
|
|
2188
|
+
};
|
|
2189
|
+
this.column = {
|
|
2190
|
+
key: 'name',
|
|
2191
|
+
grow: 1,
|
|
2192
|
+
width: 0,
|
|
2193
|
+
render: (item, rowProps) => (React.createElement("div", { key: rowProps.id, className: css$s.renderItem },
|
|
2194
|
+
this.props.renderItem(item, rowProps),
|
|
2195
|
+
React.createElement(FlexSpacer, null),
|
|
2196
|
+
(rowProps.isChildrenSelected || rowProps.isSelected) && (React.createElement("div", { className: css$s.iconWrapper },
|
|
2197
|
+
React.createElement(IconContainer, { icon: this.getIcon(this.props.size), cx: rowProps.isChildrenSelected ? css$s.iconDefault : css$s.iconPrimary }))))),
|
|
2198
|
+
};
|
|
2199
|
+
this.renderContent = () => {
|
|
2200
|
+
return (React.createElement(DataTableCell, { key: "name", size: this.props.size || '36', padding: this.props.padding || '24', isFirstColumn: true, isLastColumn: false, tabIndex: -1, column: this.column, rowProps: this.props, alignActions: this.props.alignActions || 'top' }));
|
|
2201
|
+
};
|
|
2202
|
+
}
|
|
2203
|
+
render() {
|
|
2204
|
+
return React.createElement(DataPickerRow$1, Object.assign({}, this.props, { cx: [css$s.pickerRow, this.props.cx], renderContent: this.renderContent }));
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
var css$r = {"typography-header":"MobileDropdownWrapper_typography-header__x4CWx","typography-block":"MobileDropdownWrapper_typography-block__qdVMl","typography-inline":"MobileDropdownWrapper_typography-inline__yk-yR","typography-16":"MobileDropdownWrapper_typography-16__keTAm","typography-14":"MobileDropdownWrapper_typography-14__kN-FT","typography-12":"MobileDropdownWrapper_typography-12__X6oPE","typography-promo":"MobileDropdownWrapper_typography-promo__tKPcE MobileDropdownWrapper_typography-header__x4CWx MobileDropdownWrapper_typography-block__qdVMl MobileDropdownWrapper_typography-inline__yk-yR","done":"MobileDropdownWrapper_done__kE5Pe","typographyHeader":"MobileDropdownWrapper_typography-header__x4CWx","typographyBlock":"MobileDropdownWrapper_typography-block__qdVMl","typographyInline":"MobileDropdownWrapper_typography-inline__yk-yR","typography16":"MobileDropdownWrapper_typography-16__keTAm","typography14":"MobileDropdownWrapper_typography-14__kN-FT","typography12":"MobileDropdownWrapper_typography-12__X6oPE","typographyPromo":"MobileDropdownWrapper_typography-promo__tKPcE MobileDropdownWrapper_typography-header__x4CWx MobileDropdownWrapper_typography-block__qdVMl MobileDropdownWrapper_typography-inline__yk-yR"};
|
|
2209
|
+
|
|
2210
|
+
const MobileDropdownWrapper = (props) => {
|
|
2211
|
+
const isVisible = isMobile();
|
|
2212
|
+
useAppMobileHeight();
|
|
2213
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2214
|
+
isVisible && React__default.createElement(DataPickerHeader, { title: props.title, close: props.close }),
|
|
2215
|
+
props.children,
|
|
2216
|
+
isVisible && React__default.createElement(LinkButton, { caption: "DONE", onClick: () => { var _a; return (_a = props.close) === null || _a === void 0 ? void 0 : _a.call(props); }, cx: css$r.done, size: "48" })));
|
|
2217
|
+
};
|
|
2218
|
+
|
|
2219
|
+
var css$q = {"typography-header":"PickerModal_typography-header__UkGcm","typography-block":"PickerModal_typography-block__ZZN4H","typography-inline":"PickerModal_typography-inline__KorkO","typography-16":"PickerModal_typography-16__iu8BL","typography-14":"PickerModal_typography-14__q81pu","typography-12":"PickerModal_typography-12__yekWT","typography-promo":"PickerModal_typography-promo__aiTeX PickerModal_typography-header__UkGcm PickerModal_typography-block__ZZN4H PickerModal_typography-inline__KorkO","sub-header-wrapper":"PickerModal_sub-header-wrapper__ArWps","switch":"PickerModal_switch__l1-Vd","typographyHeader":"PickerModal_typography-header__UkGcm","typographyBlock":"PickerModal_typography-block__ZZN4H","typographyInline":"PickerModal_typography-inline__KorkO","typography16":"PickerModal_typography-16__iu8BL","typography14":"PickerModal_typography-14__q81pu","typography12":"PickerModal_typography-12__yekWT","typographyPromo":"PickerModal_typography-promo__aiTeX PickerModal_typography-header__UkGcm PickerModal_typography-block__ZZN4H PickerModal_typography-inline__KorkO","subHeaderWrapper":"PickerModal_sub-header-wrapper__ArWps","$switch$":"PickerModal_switch__l1-Vd"};
|
|
2220
|
+
|
|
2221
|
+
var _path$h, _path2;
|
|
2222
|
+
function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
|
|
2223
|
+
var SvgSearchWithBackground = function SvgSearchWithBackground(props, ref) {
|
|
2224
|
+
return /*#__PURE__*/React.createElement("svg", _extends$i({
|
|
2225
|
+
width: 66,
|
|
2226
|
+
height: 67,
|
|
2227
|
+
viewBox: "0 0 66 67",
|
|
2228
|
+
fill: "none",
|
|
2229
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2230
|
+
ref: ref
|
|
2231
|
+
}, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
|
|
2232
|
+
d: "M0 33.5C0 15.275 14.775.5 33 .5s33 14.775 33 33-14.775 33-33 33-33-14.775-33-33Z",
|
|
2233
|
+
fill: "#EBEDF5"
|
|
2234
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
2235
|
+
fillRule: "evenodd",
|
|
2236
|
+
clipRule: "evenodd",
|
|
2237
|
+
d: "m42.31 40.335 7.165 7.165L47 49.975l-7.165-7.165a13.94 13.94 0 0 1-8.585 2.94c-7.732 0-14-6.268-14-14s6.268-14 14-14 14 6.268 14 14a13.94 13.94 0 0 1-2.94 8.585ZM31.25 42.25c5.799 0 10.5-4.701 10.5-10.5s-4.701-10.5-10.5-10.5-10.5 4.701-10.5 10.5 4.701 10.5 10.5 10.5Z",
|
|
2238
|
+
fill: "#6C6F80"
|
|
2239
|
+
})));
|
|
2240
|
+
};
|
|
2241
|
+
var ForwardRef$i = /*#__PURE__*/forwardRef(SvgSearchWithBackground);
|
|
2242
|
+
|
|
2243
|
+
class PickerModalImpl extends PickerModalBase {
|
|
2244
|
+
constructor() {
|
|
2245
|
+
super(...arguments);
|
|
2246
|
+
this.renderNotFound = () => {
|
|
2247
|
+
return this.props.renderNotFound ? (this.props.renderNotFound({ search: this.state.dataSourceState.search, onClose: () => this.props.success(null) })) : (React.createElement("div", { className: css$q.noFoundModalContainer },
|
|
2248
|
+
React.createElement(IconContainer, { cx: css$q.noFoundModalContainerIcon, icon: ForwardRef$i }),
|
|
2249
|
+
React.createElement(Text, { cx: css$q.noFoundModalContainerText, font: "semibold", fontSize: "16", lineHeight: "24", color: "primary", size: "36" }, i18n.dataPickerBody.noRecordsMessage),
|
|
2250
|
+
React.createElement(Text, { cx: css$q.noFoundModalContainerText, fontSize: "12", lineHeight: "18", font: "regular", color: "primary", size: "36" }, i18n.dataPickerBody.noRecordsSubTitle)));
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
renderRow(rowProps) {
|
|
2254
|
+
return this.props.renderRow ? (this.props.renderRow(rowProps, this.state.dataSourceState)) : (React.createElement(DataPickerRow, Object.assign({}, rowProps, { key: rowProps.rowKey, borderBottom: "none", padding: "24", size: "36", renderItem: (i) => React.createElement(Text, { size: "36" }, rowProps.isLoading ? React.createElement(TextPlaceholder, { wordsCount: 2 }) : this.getName(i)) })));
|
|
2255
|
+
}
|
|
2256
|
+
renderFooter() {
|
|
2257
|
+
const view = this.getView();
|
|
2258
|
+
const hasSelection = view.getSelectedRowsCount() > 0;
|
|
2259
|
+
return (React.createElement(React.Fragment, null,
|
|
2260
|
+
view.selectAll && (React.createElement(LinkButton, { caption: hasSelection ? i18n.pickerModal.clearAllButton : i18n.pickerModal.selectAllButton, onClick: hasSelection ? () => this.clearSelection() : () => view.selectAll.onValueChange(true) })),
|
|
2261
|
+
React.createElement(FlexSpacer, null),
|
|
2262
|
+
React.createElement(Button, { mode: "outline", color: "secondary", caption: i18n.pickerModal.cancelButton, onClick: () => this.props.abort() }),
|
|
2263
|
+
React.createElement(Button, { color: "accent", caption: i18n.pickerModal.selectButton, onClick: () => this.props.success(null) })));
|
|
2264
|
+
}
|
|
2265
|
+
render() {
|
|
2266
|
+
const view = this.getView();
|
|
2267
|
+
const dataRows = this.getRows();
|
|
2268
|
+
const rows = dataRows.map((props) => this.renderRow(props));
|
|
2269
|
+
return (React.createElement(ModalBlocker, Object.assign({}, this.props),
|
|
2270
|
+
React.createElement(ModalWindow, { width: 600, height: 700 },
|
|
2271
|
+
React.createElement(ModalHeader, { title: this.props.caption || i18n.pickerModal.headerTitle, onClose: () => this.props.abort() }),
|
|
2272
|
+
React.createElement(FlexCell, { cx: css$q.subHeaderWrapper },
|
|
2273
|
+
React.createElement(FlexRow, { vPadding: "24" },
|
|
2274
|
+
React.createElement(SearchInput, Object.assign({}, this.lens.prop('dataSourceState').prop('search').toProps(), { onKeyDown: (e) => handleDataSourceKeyboard({
|
|
2275
|
+
value: this.getDataSourceState(),
|
|
2276
|
+
onValueChange: this.handleDataSourceValueChange,
|
|
2277
|
+
listView: view,
|
|
2278
|
+
rows: dataRows,
|
|
2279
|
+
editMode: 'modal',
|
|
2280
|
+
}, e), autoFocus: true, placeholder: i18n.pickerModal.searchPlaceholder }))),
|
|
2281
|
+
!this.isSingleSelect() && (React.createElement(Switch, Object.assign({ cx: css$q.switch, size: "18" }, this.stateLens.prop('showSelected').toProps(), { isDisabled: view.getSelectedRowsCount() < 1, label: "Show only selected" }))),
|
|
2282
|
+
this.props.renderFilter && React.createElement(FlexCell, { grow: 2 }, this.props.renderFilter(this.lens.prop('dataSourceState').prop('filter').toProps()))),
|
|
2283
|
+
React.createElement(DataPickerBody, Object.assign({}, this.getListProps(), { value: this.getDataSourceState(), onValueChange: this.handleDataSourceValueChange, search: this.lens.prop('dataSourceState').prop('search').toProps(), showSearch: false, rows: rows, renderNotFound: this.renderNotFound, editMode: "modal" })),
|
|
2284
|
+
React.createElement(ModalFooter, { padding: "24", vPadding: "24" }, this.props.renderFooter ? this.props.renderFooter(this.getFooterProps()) : this.renderFooter()))));
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
class PickerModal extends React.Component {
|
|
2288
|
+
constructor() {
|
|
2289
|
+
super(...arguments);
|
|
2290
|
+
this.state = { selection: this.props.initialValue };
|
|
2291
|
+
this.lens = Lens.onState(this);
|
|
2292
|
+
}
|
|
2293
|
+
render() {
|
|
2294
|
+
return React.createElement(PickerModalImpl, Object.assign({}, this.props, this.lens.prop('selection').toProps(), { success: () => this.props.success(this.state.selection) }));
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
const Avatar = withMods(Avatar$1, () => []);
|
|
2299
|
+
|
|
2300
|
+
var css$p = {"root":"AvatarStack_root__Tsg6N"};
|
|
2301
|
+
|
|
2302
|
+
const AvatarStack = withMods(AvatarStack$1, () => [css$p.root]);
|
|
2303
|
+
|
|
2304
|
+
var css$o = {"typography-header":"Badge_typography-header__zhcFQ","typography-block":"Badge_typography-block__aR47j","typography-inline":"Badge_typography-inline__MLd7F","typography-16":"Badge_typography-16__gwWRC","typography-14":"Badge_typography-14__ins26","typography-12":"Badge_typography-12__pj7lQ","typography-promo":"Badge_typography-promo__jJwa3 Badge_typography-header__zhcFQ Badge_typography-block__aR47j Badge_typography-inline__MLd7F","root":"Badge_root__wIzSP","size-18":"Badge_size-18__-VlZJ","fill-transparent":"Badge_fill-transparent__za27N","size-24":"Badge_size-24__WZsqd","size-30":"Badge_size-30__oGbuk","size-36":"Badge_size-36__MMdK5","size-42":"Badge_size-42__MOPTB","size-48":"Badge_size-48__FEYnJ","fill-solid":"Badge_fill-solid__ptnEO","fill-semitransparent":"Badge_fill-semitransparent__Nd9RN","typographyHeader":"Badge_typography-header__zhcFQ","typographyBlock":"Badge_typography-block__aR47j","typographyInline":"Badge_typography-inline__MLd7F","typography16":"Badge_typography-16__gwWRC","typography14":"Badge_typography-14__ins26","typography12":"Badge_typography-12__pj7lQ","typographyPromo":"Badge_typography-promo__jJwa3 Badge_typography-header__zhcFQ Badge_typography-block__aR47j Badge_typography-inline__MLd7F","size18":"Badge_size-18__-VlZJ","fillTransparent":"Badge_fill-transparent__za27N","size24":"Badge_size-24__WZsqd","size30":"Badge_size-30__oGbuk","size36":"Badge_size-36__MMdK5","size42":"Badge_size-42__MOPTB","size48":"Badge_size-48__FEYnJ","fillSolid":"Badge_fill-solid__ptnEO","fillSemitransparent":"Badge_fill-semitransparent__Nd9RN"};
|
|
2305
|
+
|
|
2306
|
+
const defaultSize$4 = '36';
|
|
2307
|
+
const mapSize$1 = {
|
|
2308
|
+
48: '48',
|
|
2309
|
+
42: '48',
|
|
2310
|
+
36: '36',
|
|
2311
|
+
30: '30',
|
|
2312
|
+
24: '30',
|
|
2313
|
+
18: '18',
|
|
2314
|
+
};
|
|
2315
|
+
function applyBadgeMods(mods) {
|
|
2316
|
+
return [
|
|
2317
|
+
css$o.root, buttonCss.root, css$o['size-' + (mods.size || defaultSize$4)], css$o['fill-' + (mods.fill || 'solid')], mods.color && `badge-${mods.color}`,
|
|
2318
|
+
];
|
|
2319
|
+
}
|
|
2320
|
+
const Badge = withMods(Button$1, applyBadgeMods, (props) => ({
|
|
2321
|
+
dropdownIcon: systemIcons[(props.size && mapSize$1[props.size]) || defaultSize$4].foldingArrow,
|
|
2322
|
+
clearIcon: systemIcons[(props.size && mapSize$1[props.size]) || defaultSize$4].clear,
|
|
2323
|
+
countPosition: 'left',
|
|
2324
|
+
}));
|
|
2325
|
+
|
|
2326
|
+
var css$n = {"typography-header":"Tag_typography-header__F6CIv","typography-block":"Tag_typography-block__3N7TQ","typography-inline":"Tag_typography-inline__Yhikn","typography-16":"Tag_typography-16__Qssa4","typography-14":"Tag_typography-14__k1h7D","typography-12":"Tag_typography-12__ZH87T","typography-promo":"Tag_typography-promo__32H9w Tag_typography-header__F6CIv Tag_typography-block__3N7TQ Tag_typography-inline__Yhikn","root":"Tag_root__610w5","size-18":"Tag_size-18__mPDDm","size-24":"Tag_size-24__VXzbd","size-30":"Tag_size-30__pmOOa","size-36":"Tag_size-36__3O1rY","size-42":"Tag_size-42__20AON","size-48":"Tag_size-48__488DB","typographyHeader":"Tag_typography-header__F6CIv","typographyBlock":"Tag_typography-block__3N7TQ","typographyInline":"Tag_typography-inline__Yhikn","typography16":"Tag_typography-16__Qssa4","typography14":"Tag_typography-14__k1h7D","typography12":"Tag_typography-12__ZH87T","typographyPromo":"Tag_typography-promo__32H9w Tag_typography-header__F6CIv Tag_typography-block__3N7TQ Tag_typography-inline__Yhikn","size18":"Tag_size-18__mPDDm","size24":"Tag_size-24__VXzbd","size30":"Tag_size-30__pmOOa","size36":"Tag_size-36__3O1rY","size42":"Tag_size-42__20AON","size48":"Tag_size-48__488DB"};
|
|
2327
|
+
|
|
2328
|
+
const defaultSize$3 = '36';
|
|
2329
|
+
const mapSize = {
|
|
2330
|
+
48: '48',
|
|
2331
|
+
42: '48',
|
|
2332
|
+
36: '36',
|
|
2333
|
+
30: '30',
|
|
2334
|
+
24: '30',
|
|
2335
|
+
18: '18',
|
|
2336
|
+
};
|
|
2337
|
+
function applyTagMods(mods) {
|
|
2338
|
+
return [css$n['size-' + (mods.size || defaultSize$3)], css$n.root];
|
|
2339
|
+
}
|
|
2340
|
+
const Tag = withMods(Button$1, applyTagMods, (props) => ({
|
|
2341
|
+
dropdownIcon: systemIcons[mapSize[props.size] || defaultSize$3].foldingArrow,
|
|
2342
|
+
clearIcon: systemIcons[mapSize[props.size] || defaultSize$3].clear,
|
|
2343
|
+
}));
|
|
2344
|
+
|
|
2345
|
+
var css$m = {"root":"Paginator_root__axS3r","spacer":"Paginator_spacer__Xicct","mode-ghost":"Paginator_mode-ghost__3igjT","size-24":"Paginator_size-24__ZlsRd","size-30":"Paginator_size-30__Uw66-","navigation-size-24":"Paginator_navigation-size-24__FpImt","navigation-size-30":"Paginator_navigation-size-30__-PWmy","modeGhost":"Paginator_mode-ghost__3igjT","size24":"Paginator_size-24__ZlsRd","size30":"Paginator_size-30__Uw66-","navigationSize24":"Paginator_navigation-size-24__FpImt","navigationSize30":"Paginator_navigation-size-30__-PWmy"};
|
|
2346
|
+
|
|
2347
|
+
var _path$g;
|
|
2348
|
+
function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
|
|
2349
|
+
var SvgNavigationChevronLeft12 = function SvgNavigationChevronLeft12(props, ref) {
|
|
2350
|
+
return /*#__PURE__*/React.createElement("svg", _extends$h({
|
|
2351
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2352
|
+
width: 12,
|
|
2353
|
+
height: 12,
|
|
2354
|
+
viewBox: "0 0 12 12",
|
|
2355
|
+
ref: ref
|
|
2356
|
+
}, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
|
|
2357
|
+
fillRule: "evenodd",
|
|
2358
|
+
d: "M7.705 3.705 7 3 4 6l3 3 .705-.705L5.415 6l2.29-2.295z",
|
|
2359
|
+
clipRule: "evenodd"
|
|
2360
|
+
})));
|
|
2361
|
+
};
|
|
2362
|
+
var ForwardRef$h = /*#__PURE__*/forwardRef(SvgNavigationChevronLeft12);
|
|
2363
|
+
|
|
2364
|
+
var _path$f;
|
|
2365
|
+
function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
|
|
2366
|
+
var SvgNavigationChevronRight12 = function SvgNavigationChevronRight12(props, ref) {
|
|
2367
|
+
return /*#__PURE__*/React.createElement("svg", _extends$g({
|
|
2368
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2369
|
+
width: 12,
|
|
2370
|
+
height: 12,
|
|
2371
|
+
viewBox: "0 0 12 12",
|
|
2372
|
+
ref: ref
|
|
2373
|
+
}, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
|
|
2374
|
+
fillRule: "evenodd",
|
|
2375
|
+
d: "m5 3-.705.705L6.585 6l-2.29 2.295L5 9l3-3-3-3z",
|
|
2376
|
+
clipRule: "evenodd"
|
|
2377
|
+
})));
|
|
2378
|
+
};
|
|
2379
|
+
var ForwardRef$g = /*#__PURE__*/forwardRef(SvgNavigationChevronRight12);
|
|
2380
|
+
|
|
2381
|
+
var _path$e;
|
|
2382
|
+
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
|
|
2383
|
+
var SvgNavigationChevronLeft18 = function SvgNavigationChevronLeft18(props, ref) {
|
|
2384
|
+
return /*#__PURE__*/React.createElement("svg", _extends$f({
|
|
2385
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2386
|
+
width: 18,
|
|
2387
|
+
height: 18,
|
|
2388
|
+
viewBox: "0 0 18 18",
|
|
2389
|
+
ref: ref
|
|
2390
|
+
}, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
|
|
2391
|
+
fillRule: "evenodd",
|
|
2392
|
+
d: "M11.557 5.558 10.5 4.5 6 9l4.5 4.5 1.057-1.057L8.123 9l3.434-3.442z",
|
|
2393
|
+
clipRule: "evenodd"
|
|
2394
|
+
})));
|
|
2395
|
+
};
|
|
2396
|
+
var ForwardRef$f = /*#__PURE__*/forwardRef(SvgNavigationChevronLeft18);
|
|
2397
|
+
|
|
2398
|
+
var _path$d;
|
|
2399
|
+
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
|
|
2400
|
+
var SvgNavigationChevronRight18 = function SvgNavigationChevronRight18(props, ref) {
|
|
2401
|
+
return /*#__PURE__*/React.createElement("svg", _extends$e({
|
|
2402
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2403
|
+
width: 18,
|
|
2404
|
+
height: 18,
|
|
2405
|
+
viewBox: "0 0 18 18",
|
|
2406
|
+
ref: ref
|
|
2407
|
+
}, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
|
|
2408
|
+
fillRule: "evenodd",
|
|
2409
|
+
d: "M7.5 4.5 6.442 5.558 9.877 9l-3.435 3.443L7.5 13.5 12 9 7.5 4.5z",
|
|
2410
|
+
clipRule: "evenodd"
|
|
2411
|
+
})));
|
|
2412
|
+
};
|
|
2413
|
+
var ForwardRef$e = /*#__PURE__*/forwardRef(SvgNavigationChevronRight18);
|
|
2414
|
+
|
|
2415
|
+
function Paginator(props) {
|
|
2416
|
+
const renderPaginator = (params) => {
|
|
2417
|
+
var _a, _b;
|
|
2418
|
+
return (React__default.createElement("nav", Object.assign({ role: "navigation", className: css$m.root }, params.rawProps),
|
|
2419
|
+
React__default.createElement(Button, { cx: css$m[`navigation-size-${(_a = params.size) !== null && _a !== void 0 ? _a : '30'}`], size: params.size, icon: params.size === '30' ? ForwardRef$f : ForwardRef$h, onClick: params.goToPrev, isDisabled: params.isFirst, mode: "outline", color: "secondary" }),
|
|
2420
|
+
params.pages.map((page, index) => {
|
|
2421
|
+
var _a, _b;
|
|
2422
|
+
if (page.type === 'spacer') {
|
|
2423
|
+
return (React__default.createElement(Button, { cx: cx(css$m[`size-${(_a = params.size) !== null && _a !== void 0 ? _a : '30'}`], css$m.spacer), size: params.size, key: `${index}_spacer`, caption: "...", mode: "ghost", color: "secondary", tabIndex: -1 }));
|
|
2424
|
+
}
|
|
2425
|
+
else {
|
|
2426
|
+
return (React__default.createElement(Button, { cx: cx(css$m[`size-${(_b = params.size) !== null && _b !== void 0 ? _b : '30'}`], css$m[`mode-${!page.isActive && 'ghost'}`]), size: params.size, key: page.pageNumber, caption: page.pageNumber, onClick: () => { var _a; return (_a = page.onClick) === null || _a === void 0 ? void 0 : _a.call(page); }, rawProps: { 'aria-current': page.isActive }, mode: (page.isActive && 'outline') || 'ghost', color: "primary" }));
|
|
2427
|
+
}
|
|
2428
|
+
}),
|
|
2429
|
+
React__default.createElement(Button, { cx: css$m[`navigation-size-${(_b = params.size) !== null && _b !== void 0 ? _b : '30'}`], size: params.size, icon: params.size === '30' ? ForwardRef$e : ForwardRef$g, onClick: params.goToNext, isDisabled: params.isLast, mode: "outline", color: "secondary" })));
|
|
2430
|
+
};
|
|
2431
|
+
return React__default.createElement(Paginator$1, Object.assign({}, props, { render: renderPaginator }));
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
const MAX_ITEMS = 100;
|
|
2435
|
+
const getMaxItems = (maxItems) => maxItems || maxItems === 0 ? maxItems : MAX_ITEMS;
|
|
2436
|
+
|
|
2437
|
+
var css$l = {"typography-header":"PickerToggler_typography-header__Wl3bF","typography-block":"PickerToggler_typography-block__ujo3e","typography-inline":"PickerToggler_typography-inline__R6g9F","typography-16":"PickerToggler_typography-16__umTFU","typography-14":"PickerToggler_typography-14__3RWdh","typography-12":"PickerToggler_typography-12__PnVPR","typography-promo":"PickerToggler_typography-promo__PFoH7 PickerToggler_typography-header__Wl3bF PickerToggler_typography-block__ujo3e PickerToggler_typography-inline__R6g9F","root":"PickerToggler_root__G7gEl","mode-form":"PickerToggler_mode-form__OlTHW","mode-cell":"PickerToggler_mode-cell__hBg0t","mode-inline":"PickerToggler_mode-inline__AIRuh","size-24":"PickerToggler_size-24__MUg2U","size-30":"PickerToggler_size-30__K0XU-","size-36":"PickerToggler_size-36__NqG3q","size-42":"PickerToggler_size-42__xm0IS","size-48":"PickerToggler_size-48__DGIi9","typographyHeader":"PickerToggler_typography-header__Wl3bF","typographyBlock":"PickerToggler_typography-block__ujo3e","typographyInline":"PickerToggler_typography-inline__R6g9F","typography16":"PickerToggler_typography-16__umTFU","typography14":"PickerToggler_typography-14__3RWdh","typography12":"PickerToggler_typography-12__PnVPR","typographyPromo":"PickerToggler_typography-promo__PFoH7 PickerToggler_typography-header__Wl3bF PickerToggler_typography-block__ujo3e PickerToggler_typography-inline__R6g9F","modeForm":"PickerToggler_mode-form__OlTHW","modeCell":"PickerToggler_mode-cell__hBg0t","modeInline":"PickerToggler_mode-inline__AIRuh","size24":"PickerToggler_size-24__MUg2U","size30":"PickerToggler_size-30__K0XU-","size36":"PickerToggler_size-36__NqG3q","size42":"PickerToggler_size-42__xm0IS","size48":"PickerToggler_size-48__DGIi9"};
|
|
2438
|
+
|
|
2439
|
+
const defaultSize$2 = '36';
|
|
2440
|
+
const defaultMode = EditMode.FORM;
|
|
2441
|
+
function applyPickerTogglerMods(mods) {
|
|
2442
|
+
return [
|
|
2443
|
+
css$l.root,
|
|
2444
|
+
css$l['size-' + (mods.size || defaultSize$2)],
|
|
2445
|
+
css$l['mode-' + (mods.mode || defaultMode)],
|
|
2446
|
+
];
|
|
2447
|
+
}
|
|
2448
|
+
function PickerTogglerComponent(props, ref) {
|
|
2449
|
+
const getPickerTogglerButtonSize = (propSize) => {
|
|
2450
|
+
switch (propSize) {
|
|
2451
|
+
case '48':
|
|
2452
|
+
return '42';
|
|
2453
|
+
case '42':
|
|
2454
|
+
return '36';
|
|
2455
|
+
case '36':
|
|
2456
|
+
return '30';
|
|
2457
|
+
case '30':
|
|
2458
|
+
return '24';
|
|
2459
|
+
case '24':
|
|
2460
|
+
return '18';
|
|
2461
|
+
}
|
|
2462
|
+
};
|
|
2463
|
+
const getCaption = (row) => {
|
|
2464
|
+
const maxItems = getMaxItems(props.maxItems);
|
|
2465
|
+
if (row.isLoading) {
|
|
2466
|
+
return React.createElement(TextPlaceholder, null);
|
|
2467
|
+
}
|
|
2468
|
+
else if (!props.getName || props.selectedRowsCount > maxItems) {
|
|
2469
|
+
return row.value;
|
|
2470
|
+
}
|
|
2471
|
+
else {
|
|
2472
|
+
return props.getName(row.value);
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
const renderItem = (row) => {
|
|
2476
|
+
var _a;
|
|
2477
|
+
return (React.createElement(Tag, { key: row.rowKey, caption: getCaption(row), tabIndex: -1, size: props.size ? getPickerTogglerButtonSize(props.size) : '30', onClear: (e) => {
|
|
2478
|
+
var _a;
|
|
2479
|
+
(_a = row.onCheck) === null || _a === void 0 ? void 0 : _a.call(row, row);
|
|
2480
|
+
e.stopPropagation();
|
|
2481
|
+
}, isDisabled: props.isDisabled || props.isReadonly || ((_a = row === null || row === void 0 ? void 0 : row.checkbox) === null || _a === void 0 ? void 0 : _a.isDisabled) }));
|
|
2482
|
+
};
|
|
2483
|
+
return (React.createElement(PickerToggler$1, Object.assign({}, props, { ref: ref, cx: [applyPickerTogglerMods(props), props.cx], renderItem: !!props.renderItem ? props.renderItem : renderItem, getName: (item) => (props.getName ? props.getName(item) : item), cancelIcon: systemIcons[props.size || defaultSize$2].clear, dropdownIcon: systemIcons[props.size || defaultSize$2].foldingArrow })));
|
|
2484
|
+
}
|
|
2485
|
+
const PickerToggler = React.forwardRef(PickerTogglerComponent);
|
|
2486
|
+
|
|
2487
|
+
var css$k = {"root":"PickerItem_root__m-i2g","multiline-vertical-padding-24":"PickerItem_multiline-vertical-padding-24__ivzzQ","multiline-vertical-padding-30":"PickerItem_multiline-vertical-padding-30__tBEW-","multiline-vertical-padding-36":"PickerItem_multiline-vertical-padding-36__NpueM","multiline-vertical-padding-42":"PickerItem_multiline-vertical-padding-42__UjLpR","multiline-vertical-padding-48":"PickerItem_multiline-vertical-padding-48__65Jdv","text":"PickerItem_text__k9Jsu","multilineVerticalPadding24":"PickerItem_multiline-vertical-padding-24__ivzzQ","multilineVerticalPadding30":"PickerItem_multiline-vertical-padding-30__tBEW-","multilineVerticalPadding36":"PickerItem_multiline-vertical-padding-36__NpueM","multilineVerticalPadding42":"PickerItem_multiline-vertical-padding-42__UjLpR","multilineVerticalPadding48":"PickerItem_multiline-vertical-padding-48__65Jdv"};
|
|
2488
|
+
|
|
2489
|
+
const defaultSize$1 = '36';
|
|
2490
|
+
class PickerItem extends React.Component {
|
|
2491
|
+
constructor() {
|
|
2492
|
+
super(...arguments);
|
|
2493
|
+
this.getAvatarSize = (size, isMultiline) => {
|
|
2494
|
+
return isMultiline ? size : +size - 6;
|
|
2495
|
+
};
|
|
2496
|
+
}
|
|
2497
|
+
render() {
|
|
2498
|
+
const { size, avatarUrl, title, subtitle, isLoading, isDisabled, icon, } = this.props;
|
|
2499
|
+
const itemSize = size && size !== 'none' ? size : defaultSize$1;
|
|
2500
|
+
const isMultiline = !!(title && subtitle);
|
|
2501
|
+
return (React.createElement(FlexCell, { width: "auto", cx: css$k.root },
|
|
2502
|
+
React.createElement(FlexRow, { size: itemSize, cx: isMultiline && css$k[`multiline-vertical-padding-${itemSize}`], spacing: "12" },
|
|
2503
|
+
avatarUrl && React.createElement(Avatar, { isLoading: isLoading, img: avatarUrl, size: this.getAvatarSize(itemSize, isMultiline).toString() }),
|
|
2504
|
+
icon && React.createElement(IconContainer, { icon: icon }),
|
|
2505
|
+
React.createElement(FlexCell, { width: "auto" },
|
|
2506
|
+
title && (React.createElement(Text, { size: itemSize, cx: css$k.text, color: isDisabled ? 'disabled' : 'primary' }, isLoading ? React.createElement(TextPlaceholder, { wordsCount: 2 }) : title)),
|
|
2507
|
+
subtitle && (React.createElement(Text, { size: itemSize, color: isDisabled ? 'disabled' : 'secondary', cx: css$k.text }, isLoading ? React.createElement(TextPlaceholder, { wordsCount: 2 }) : subtitle))))));
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
var css$j = {"typography-header":"PickerInput_typography-header__pZmu4","typography-block":"PickerInput_typography-block__MMlH6","typography-inline":"PickerInput_typography-inline__3Z1Fw","typography-16":"PickerInput_typography-16__58rbi","typography-14":"PickerInput_typography-14__CCnu9","typography-12":"PickerInput_typography-12__T51Lb","typography-promo":"PickerInput_typography-promo__tcN6K PickerInput_typography-header__pZmu4 PickerInput_typography-block__MMlH6 PickerInput_typography-inline__3Z1Fw","panel":"PickerInput_panel__0GHsI","footer-wrapper":"PickerInput_footer-wrapper__hMVx6","footer-size-24":"PickerInput_footer-size-24__X1s8w","footer-size-30":"PickerInput_footer-size-30__2kxYO","footer-size-36":"PickerInput_footer-size-36__xEFus","footer-size-42":"PickerInput_footer-size-42__q6lln","footer-size-48":"PickerInput_footer-size-48__uP99C","typographyHeader":"PickerInput_typography-header__pZmu4","typographyBlock":"PickerInput_typography-block__MMlH6","typographyInline":"PickerInput_typography-inline__3Z1Fw","typography16":"PickerInput_typography-16__58rbi","typography14":"PickerInput_typography-14__CCnu9","typography12":"PickerInput_typography-12__T51Lb","typographyPromo":"PickerInput_typography-promo__tcN6K PickerInput_typography-header__pZmu4 PickerInput_typography-block__MMlH6 PickerInput_typography-inline__3Z1Fw","footerWrapper":"PickerInput_footer-wrapper__hMVx6","footerSize24":"PickerInput_footer-size-24__X1s8w","footerSize30":"PickerInput_footer-size-30__2kxYO","footerSize36":"PickerInput_footer-size-36__xEFus","footerSize42":"PickerInput_footer-size-42__q6lln","footerSize48":"PickerInput_footer-size-48__uP99C"};
|
|
2512
|
+
|
|
2513
|
+
const pickerHeight$1 = 300;
|
|
2514
|
+
const pickerWidth$1 = 360;
|
|
2515
|
+
class PickerInput extends PickerInputBase {
|
|
2516
|
+
constructor() {
|
|
2517
|
+
super(...arguments);
|
|
2518
|
+
this.renderItem = (item, rowProps) => {
|
|
2519
|
+
return React__default.createElement(PickerItem, Object.assign({ title: this.getName(item), size: this.getRowSize() }, rowProps));
|
|
2520
|
+
};
|
|
2521
|
+
this.renderRow = (rowProps) => {
|
|
2522
|
+
return this.props.renderRow ? (this.props.renderRow(rowProps, this.state.dataSourceState)) : (React__default.createElement(DataPickerRow, Object.assign({}, rowProps, { key: rowProps.rowKey, borderBottom: "none", size: this.getRowSize(), padding: this.props.editMode === 'modal' ? '24' : '12', renderItem: this.renderItem })));
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
toggleModalOpening() {
|
|
2526
|
+
const _a = this.props, { renderFooter, rawProps } = _a, restProps = __rest(_a, ["renderFooter", "rawProps"]);
|
|
2527
|
+
this.context.uuiModals
|
|
2528
|
+
.show((props) => (React__default.createElement(PickerModal, Object.assign({}, restProps, { rawProps: rawProps === null || rawProps === void 0 ? void 0 : rawProps.body }, props, { caption: this.getPlaceholder(), initialValue: this.props.value, renderRow: this.renderRow, selectionMode: this.props.selectionMode, valueType: this.props.valueType }))))
|
|
2529
|
+
.then((newSelection) => {
|
|
2530
|
+
this.handleSelectionValueChange(newSelection);
|
|
2531
|
+
this.returnFocusToInput();
|
|
2532
|
+
})
|
|
2533
|
+
.catch(() => {
|
|
2534
|
+
this.returnFocusToInput();
|
|
2535
|
+
});
|
|
2536
|
+
}
|
|
2537
|
+
getRowSize() {
|
|
2538
|
+
if (isMobile()) {
|
|
2539
|
+
return '48';
|
|
2540
|
+
}
|
|
2541
|
+
return this.props.editMode === 'modal' ? '36' : this.props.size;
|
|
2542
|
+
}
|
|
2543
|
+
getTogglerMods() {
|
|
2544
|
+
return {
|
|
2545
|
+
size: this.props.size,
|
|
2546
|
+
mode: this.props.mode ? this.props.mode : EditMode.FORM,
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
renderFooter() {
|
|
2550
|
+
const footerProps = this.getFooterProps();
|
|
2551
|
+
return this.props.renderFooter ? (this.props.renderFooter(footerProps)) : (React__default.createElement(DataPickerFooter, Object.assign({}, footerProps, { size: this.props.size })));
|
|
2552
|
+
}
|
|
2553
|
+
renderTarget(targetProps) {
|
|
2554
|
+
const renderTarget = this.props.renderToggler || ((props) => React__default.createElement(PickerToggler, Object.assign({}, props)));
|
|
2555
|
+
return (React__default.createElement(IEditableDebouncer, { value: targetProps.value, onValueChange: this.handleTogglerSearchChange, render: (editableProps) => renderTarget(Object.assign(Object.assign(Object.assign({}, this.getTogglerMods()), targetProps), editableProps)) }));
|
|
2556
|
+
}
|
|
2557
|
+
renderBody(props, rows) {
|
|
2558
|
+
const renderedDataRows = rows.map((row) => this.renderRow(row));
|
|
2559
|
+
const maxHeight = isMobile() ? document.documentElement.clientHeight : this.props.dropdownHeight || pickerHeight$1;
|
|
2560
|
+
const minBodyWidth = isMobile() ? document.documentElement.clientWidth : this.props.minBodyWidth || pickerWidth$1;
|
|
2561
|
+
return (React__default.createElement(Panel, { style: { width: props.togglerWidth > minBodyWidth ? props.togglerWidth : minBodyWidth }, rawProps: { tabIndex: -1 }, cx: [
|
|
2562
|
+
css$j.panel, uuiMarkers.lockFocus, this.props.bodyCx,
|
|
2563
|
+
] },
|
|
2564
|
+
React__default.createElement(MobileDropdownWrapper, { title: this.props.entityName, close: () => {
|
|
2565
|
+
this.returnFocusToInput();
|
|
2566
|
+
this.toggleBodyOpening(false);
|
|
2567
|
+
} },
|
|
2568
|
+
React__default.createElement(DataPickerBody, Object.assign({}, props, { rows: renderedDataRows, maxHeight: maxHeight, searchSize: this.props.size, editMode: "dropdown", selectionMode: this.props.selectionMode, renderNotFound: this.props.renderNotFound
|
|
2569
|
+
? () => this.props.renderNotFound({
|
|
2570
|
+
search: this.state.dataSourceState.search,
|
|
2571
|
+
onClose: () => this.toggleBodyOpening(false),
|
|
2572
|
+
})
|
|
2573
|
+
: undefined })),
|
|
2574
|
+
this.renderFooter())));
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
var css$i = {"row":"PickerListItem_row__1Uzrn"};
|
|
2579
|
+
|
|
2580
|
+
class PickerListItem extends React__default.Component {
|
|
2581
|
+
render() {
|
|
2582
|
+
let label;
|
|
2583
|
+
if (this.props.isLoading) {
|
|
2584
|
+
label = React__default.createElement(TextPlaceholder, { wordsCount: 2 });
|
|
2585
|
+
}
|
|
2586
|
+
else {
|
|
2587
|
+
label = this.props.getName(this.props.value);
|
|
2588
|
+
}
|
|
2589
|
+
let component;
|
|
2590
|
+
if (this.props.checkbox) {
|
|
2591
|
+
component = (React__default.createElement(Checkbox, Object.assign({}, this.props.checkbox, { isDisabled: this.props.isLoading || this.props.checkbox.isDisabled || this.props.isDisabled, label: label, value: this.props.isChecked, onValueChange: () => this.props.onCheck(this.props) })));
|
|
2592
|
+
}
|
|
2593
|
+
else {
|
|
2594
|
+
component = (React__default.createElement(RadioInput, { label: label, value: this.props.isSelected, isDisabled: this.props.isLoading || !this.props.isSelectable || this.props.isDisabled, onValueChange: () => this.props.onSelect(this.props) }));
|
|
2595
|
+
}
|
|
2596
|
+
return React__default.createElement("div", { className: css$i.row }, component);
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
class PickerList extends PickerListBase {
|
|
2601
|
+
constructor() {
|
|
2602
|
+
super(...arguments);
|
|
2603
|
+
this.sessionStartTime = new Date().getTime();
|
|
2604
|
+
this.renderRow = (row) => {
|
|
2605
|
+
return React__default.createElement(PickerListItem, Object.assign({ getName: (item) => this.getName(item) }, row, { key: row.rowKey }));
|
|
2606
|
+
};
|
|
2607
|
+
this.handleShowPicker = () => {
|
|
2608
|
+
this.context.uuiModals
|
|
2609
|
+
.show((props) => (React__default.createElement(PickerModal, Object.assign({}, props, this.props, { caption: this.props.placeholder || `Please select ${this.getEntityName() ? this.getEntityName() : ''}`, initialValue: this.props.value, selectionMode: this.props.selectionMode, valueType: this.props.valueType }))))
|
|
2610
|
+
.then((value) => {
|
|
2611
|
+
this.appendLastSelected([...this.getSelectedIdsArray(value)]);
|
|
2612
|
+
this.props.onValueChange(value);
|
|
2613
|
+
});
|
|
2614
|
+
};
|
|
2615
|
+
this.defaultRenderToggler = (props) => React__default.createElement(LinkButton, Object.assign({ caption: "Show all" }, props));
|
|
2616
|
+
}
|
|
2617
|
+
render() {
|
|
2618
|
+
const view = this.getView();
|
|
2619
|
+
const viewProps = view.getListProps();
|
|
2620
|
+
const selectedRows = view.getSelectedRows();
|
|
2621
|
+
const rows = this.buildRowsList();
|
|
2622
|
+
const showPicker = viewProps.totalCount == null || viewProps.totalCount > this.getMaxDefaultItems();
|
|
2623
|
+
const renderToggler = this.props.renderModalToggler || this.defaultRenderToggler;
|
|
2624
|
+
const renderRow = this.props.renderRow || this.renderRow;
|
|
2625
|
+
return (React__default.createElement("div", null,
|
|
2626
|
+
!rows.length
|
|
2627
|
+
&& (this.props.noOptionsMessage || (React__default.createElement(Text, { color: "secondary", size: this.props.size }, "No options available"))),
|
|
2628
|
+
rows.map((row) => renderRow(Object.assign(Object.assign({}, row), { isDisabled: this.props.isDisabled }), this.state.dataSourceState)),
|
|
2629
|
+
showPicker
|
|
2630
|
+
&& renderToggler({
|
|
2631
|
+
onClick: this.handleShowPicker,
|
|
2632
|
+
caption: this.getModalTogglerCaption(viewProps.totalCount, view.getSelectedRowsCount()),
|
|
2633
|
+
isDisabled: this.props.isDisabled,
|
|
2634
|
+
}, selectedRows)));
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
PickerList.contextType = UuiContext;
|
|
2638
|
+
|
|
2639
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2640
|
+
|
|
2641
|
+
var dayjs_minExports = {};
|
|
2642
|
+
var dayjs_min = {
|
|
2643
|
+
get exports(){ return dayjs_minExports; },
|
|
2644
|
+
set exports(v){ dayjs_minExports = v; },
|
|
2645
|
+
};
|
|
2646
|
+
|
|
2647
|
+
(function (module, exports) {
|
|
2648
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
|
|
2649
|
+
} (dayjs_min));
|
|
2650
|
+
|
|
2651
|
+
var css$h = {"typography-header":"FilterPanelItemToggler_typography-header__nwnk9","typography-block":"FilterPanelItemToggler_typography-block__RS98Q","typography-inline":"FilterPanelItemToggler_typography-inline__GBz0E","typography-16":"FilterPanelItemToggler_typography-16__ilpGd","typography-14":"FilterPanelItemToggler_typography-14__O2RUd","typography-12":"FilterPanelItemToggler_typography-12__kvTGV","typography-promo":"FilterPanelItemToggler_typography-promo__6cloV FilterPanelItemToggler_typography-header__nwnk9 FilterPanelItemToggler_typography-block__RS98Q FilterPanelItemToggler_typography-inline__GBz0E","root":"FilterPanelItemToggler_root__KIGYZ","title-wrapper":"FilterPanelItemToggler_title-wrapper__hrBtt","title":"FilterPanelItemToggler_title__wECIj","text-wrapper":"FilterPanelItemToggler_text-wrapper__lYOV6","selection":"FilterPanelItemToggler_selection__4HBx1","postfix":"FilterPanelItemToggler_postfix__Sz2ir","selected":"FilterPanelItemToggler_selected__97jlL","typographyHeader":"FilterPanelItemToggler_typography-header__nwnk9","typographyBlock":"FilterPanelItemToggler_typography-block__RS98Q","typographyInline":"FilterPanelItemToggler_typography-inline__GBz0E","typography16":"FilterPanelItemToggler_typography-16__ilpGd","typography14":"FilterPanelItemToggler_typography-14__O2RUd","typography12":"FilterPanelItemToggler_typography-12__kvTGV","typographyPromo":"FilterPanelItemToggler_typography-promo__6cloV FilterPanelItemToggler_typography-header__nwnk9 FilterPanelItemToggler_typography-block__RS98Q FilterPanelItemToggler_typography-inline__GBz0E","titleWrapper":"FilterPanelItemToggler_title-wrapper__hrBtt","textWrapper":"FilterPanelItemToggler_text-wrapper__lYOV6"};
|
|
2652
|
+
|
|
2653
|
+
const defaultSize = '36';
|
|
2654
|
+
const FilterPanelItemToggler = React.forwardRef((props, ref) => {
|
|
2655
|
+
const togglerPickerOpened = (e) => {
|
|
2656
|
+
var _a;
|
|
2657
|
+
if (props.isDisabled)
|
|
2658
|
+
return;
|
|
2659
|
+
e.preventDefault();
|
|
2660
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
2661
|
+
};
|
|
2662
|
+
const getTitle = props.predicateName ? `${props.title} ${props.predicateName}` : `${props.title}:`;
|
|
2663
|
+
return (React.createElement(FlexRow$1, Object.assign({}, props, { rawProps: {
|
|
2664
|
+
style: { maxWidth: `${props.maxWidth ? props.maxWidth + 'px' : 'auto'}` },
|
|
2665
|
+
role: 'button',
|
|
2666
|
+
}, cx: cx(css$h.root, uuiElement.inputBox, uuiMarkers.clickable, props.isOpen && uuiMod.opened, ['size-' + (props.size || defaultSize)], props.cx), onClick: togglerPickerOpened, ref: ref }),
|
|
2667
|
+
React.createElement(FlexRow$1, { cx: css$h.titleWrapper },
|
|
2668
|
+
React.createElement(Text, { cx: css$h.title }, getTitle),
|
|
2669
|
+
React.createElement("div", { className: css$h.textWrapper },
|
|
2670
|
+
React.createElement(Text, { color: "brand", cx: css$h.selection }, props.selection),
|
|
2671
|
+
props.postfix && (React.createElement(Text, { color: "brand", cx: css$h.postfix }, props.postfix)))),
|
|
2672
|
+
!props.isDisabled && React.createElement(IconContainer, { icon: systemIcons[props.size || defaultSize].foldingArrow, flipY: props.isOpen, cx: "uui-icon-dropdown" })));
|
|
2673
|
+
});
|
|
2674
|
+
|
|
2675
|
+
const pickerHeight = 300;
|
|
2676
|
+
const pickerWidth = 360;
|
|
2677
|
+
class FilterPickerBody extends PickerInputBase {
|
|
2678
|
+
constructor() {
|
|
2679
|
+
super(...arguments);
|
|
2680
|
+
this.renderItem = (item, rowProps) => {
|
|
2681
|
+
return React.createElement(PickerItem, Object.assign({ title: this.getName(item), size: "36" }, rowProps));
|
|
2682
|
+
};
|
|
2683
|
+
this.onSelect = (row) => {
|
|
2684
|
+
this.props.onClose();
|
|
2685
|
+
this.handleDataSourceValueChange(Object.assign(Object.assign({}, this.state.dataSourceState), { search: '', selectedId: row.id }));
|
|
2686
|
+
};
|
|
2687
|
+
this.renderRow = (rowProps) => {
|
|
2688
|
+
if (rowProps.isSelectable && this.isSingleSelect() && this.props.editMode !== 'modal') {
|
|
2689
|
+
rowProps.onSelect = this.onSelect;
|
|
2690
|
+
}
|
|
2691
|
+
return this.props.renderRow ? (this.props.renderRow(rowProps, this.state.dataSourceState)) : (React.createElement(DataPickerRow, Object.assign({}, rowProps, { key: rowProps.rowKey, borderBottom: "none", size: "36", padding: "12", renderItem: this.renderItem })));
|
|
2692
|
+
};
|
|
2693
|
+
this.renderFooter = () => {
|
|
2694
|
+
return React.createElement(DataPickerFooter, Object.assign({}, this.getFooterProps(), { size: "36" }));
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
shouldShowBody() {
|
|
2698
|
+
return this.props.isOpen;
|
|
2699
|
+
}
|
|
2700
|
+
toggleModalOpening(opened) { }
|
|
2701
|
+
renderTarget(targetProps) {
|
|
2702
|
+
return React.createElement("div", null);
|
|
2703
|
+
}
|
|
2704
|
+
renderBody(props, rows) {
|
|
2705
|
+
const renderedDataRows = rows.map((props) => this.renderRow(props));
|
|
2706
|
+
const maxHeight = isMobile() ? document.documentElement.clientHeight : this.props.dropdownHeight || pickerHeight;
|
|
2707
|
+
const minBodyWidth = isMobile() ? document.documentElement.clientWidth : this.props.minBodyWidth || pickerWidth;
|
|
2708
|
+
return (React.createElement(Panel, { style: { width: minBodyWidth }, rawProps: { tabIndex: -1 }, cx: [uuiMarkers.lockFocus] },
|
|
2709
|
+
React.createElement(DataPickerBody, Object.assign({}, props, { selectionMode: this.props.selectionMode, rows: renderedDataRows, maxHeight: maxHeight, searchSize: "36", editMode: "dropdown", showSearch: true })),
|
|
2710
|
+
this.renderFooter()));
|
|
2711
|
+
}
|
|
2712
|
+
render() {
|
|
2713
|
+
const rows = this.getRows();
|
|
2714
|
+
return this.renderBody(Object.assign(Object.assign({}, this.getPickerBodyProps(rows)), this.getListProps()), rows);
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
class FilterDataPickerBody extends BaseDatePicker {
|
|
2719
|
+
constructor() {
|
|
2720
|
+
super(...arguments);
|
|
2721
|
+
this.state = Object.assign(Object.assign({}, super.getValue()), { isOpen: false, inputValue: null });
|
|
2722
|
+
this.renderInput = () => {
|
|
2723
|
+
return null;
|
|
2724
|
+
};
|
|
2725
|
+
this.onToggleHandler = (val) => {
|
|
2726
|
+
this.onToggle(val);
|
|
2727
|
+
this.props.onClose();
|
|
2728
|
+
};
|
|
2729
|
+
this.handleCancel = () => {
|
|
2730
|
+
this.handleValueChange(undefined);
|
|
2731
|
+
this.setState({ inputValue: null, selectedDate: null });
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
renderBody() {
|
|
2735
|
+
var _a;
|
|
2736
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2737
|
+
React__default.createElement(FlexRow, { borderBottom: true },
|
|
2738
|
+
React__default.createElement(DatePickerBody, { filter: this.props.filter, value: this.getValue(), setSelectedDate: this.setSelectedDate, setDisplayedDateAndView: this.setDisplayedDateAndView, changeIsOpen: this.onToggleHandler, renderDay: this.props.renderDay, isHoliday: this.props.isHoliday, rawProps: (_a = this.props.rawProps) === null || _a === void 0 ? void 0 : _a.body })),
|
|
2739
|
+
React__default.createElement(FlexCell, { alignSelf: "stretch" },
|
|
2740
|
+
React__default.createElement(FlexRow, { padding: "24", vPadding: "12" },
|
|
2741
|
+
React__default.createElement(Text, null, this.state.selectedDate ? dayjs_minExports(this.state.selectedDate).format('MMM DD, YYYY') : ''),
|
|
2742
|
+
React__default.createElement(FlexSpacer, null),
|
|
2743
|
+
React__default.createElement(LinkButton, { isDisabled: !this.state.selectedDate, caption: i18n.filterToolbar.datePicker.clearCaption, onClick: this.handleCancel })))));
|
|
2744
|
+
}
|
|
2745
|
+
render() {
|
|
2746
|
+
return this.renderBody();
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
var css$g = {"typography-header":"FilterRangeDatePickerBody_typography-header__HGaXO","typography-block":"FilterRangeDatePickerBody_typography-block__xPG--","typography-inline":"FilterRangeDatePickerBody_typography-inline__M3AvG","typography-16":"FilterRangeDatePickerBody_typography-16__gUKHq","typography-14":"FilterRangeDatePickerBody_typography-14__Cf-Is","typography-12":"FilterRangeDatePickerBody_typography-12__gG1-W","typography-promo":"FilterRangeDatePickerBody_typography-promo__ENzVq FilterRangeDatePickerBody_typography-header__HGaXO FilterRangeDatePickerBody_typography-block__xPG-- FilterRangeDatePickerBody_typography-inline__M3AvG","date-input":"FilterRangeDatePickerBody_date-input__5E3aM","size-24":"FilterRangeDatePickerBody_size-24__tTZkD","size-30":"FilterRangeDatePickerBody_size-30__YcAKz","size-36":"FilterRangeDatePickerBody_size-36__On-Tz","size-42":"FilterRangeDatePickerBody_size-42__Qe9fl","size-48":"FilterRangeDatePickerBody_size-48__5yljc","date-input-group":"FilterRangeDatePickerBody_date-input-group__cYRz6","separator":"FilterRangeDatePickerBody_separator__Txi2W","mode-form":"FilterRangeDatePickerBody_mode-form__V4zoN","mode-cell":"FilterRangeDatePickerBody_mode-cell__RA5Pu","typographyHeader":"FilterRangeDatePickerBody_typography-header__HGaXO","typographyBlock":"FilterRangeDatePickerBody_typography-block__xPG--","typographyInline":"FilterRangeDatePickerBody_typography-inline__M3AvG","typography16":"FilterRangeDatePickerBody_typography-16__gUKHq","typography14":"FilterRangeDatePickerBody_typography-14__Cf-Is","typography12":"FilterRangeDatePickerBody_typography-12__gG1-W","typographyPromo":"FilterRangeDatePickerBody_typography-promo__ENzVq FilterRangeDatePickerBody_typography-header__HGaXO FilterRangeDatePickerBody_typography-block__xPG-- FilterRangeDatePickerBody_typography-inline__M3AvG","dateInput":"FilterRangeDatePickerBody_date-input__5E3aM","size24":"FilterRangeDatePickerBody_size-24__tTZkD","size30":"FilterRangeDatePickerBody_size-30__YcAKz","size36":"FilterRangeDatePickerBody_size-36__On-Tz","size42":"FilterRangeDatePickerBody_size-42__Qe9fl","size48":"FilterRangeDatePickerBody_size-48__5yljc","dateInputGroup":"FilterRangeDatePickerBody_date-input-group__cYRz6","modeForm":"FilterRangeDatePickerBody_mode-form__V4zoN","modeCell":"FilterRangeDatePickerBody_mode-cell__RA5Pu"};
|
|
2751
|
+
|
|
2752
|
+
class FilterRangeDatePickerBody extends BaseRangeDatePicker {
|
|
2753
|
+
constructor() {
|
|
2754
|
+
super(...arguments);
|
|
2755
|
+
this.state = Object.assign(Object.assign({}, super.getInitialState()), { inFocus: 'from' });
|
|
2756
|
+
this.renderInput = () => {
|
|
2757
|
+
return null;
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
renderBody() {
|
|
2761
|
+
return (React.createElement(React.Fragment, null,
|
|
2762
|
+
React.createElement(FlexRow, { borderBottom: true },
|
|
2763
|
+
React.createElement(RangeDatePickerBody, { value: this.getValue(), onValueChange: this.onRangeChange, filter: this.props.filter, focusPart: this.state.inFocus, changeIsOpen: this.toggleOpening })),
|
|
2764
|
+
React.createElement(FlexCell, { alignSelf: "stretch" },
|
|
2765
|
+
React.createElement(FlexRow, { padding: "24", vPadding: "12" },
|
|
2766
|
+
React.createElement("div", { className: cx(css$g.dateInputGroup, this.state.inFocus && uuiMod.focus) },
|
|
2767
|
+
React.createElement(TextInput, { icon: systemIcons['30'].calendar, cx: cx(css$g.dateInput, css$g['size-30'], this.state.inFocus === 'from' && uuiMod.focus), size: "30", placeholder: i18n.rangeDatePicker.pickerPlaceholderFrom, value: this.state.inputValue.from, onValueChange: this.getChangeHandler('from'), onFocus: (event) => this.handleFocus(event, 'from'), onBlur: (event) => this.handleBlur(event, 'from') }),
|
|
2768
|
+
React.createElement("div", { className: css$g.separator }),
|
|
2769
|
+
React.createElement(TextInput, { cx: cx(css$g.dateInput, css$g['size-30'], this.state.inFocus === 'to' && uuiMod.focus), placeholder: i18n.rangeDatePicker.pickerPlaceholderTo, size: "30", value: this.state.inputValue.to, onCancel: this.state.inputValue.from && this.state.inputValue.to && this.handleCancel, onValueChange: this.getChangeHandler('to'), onFocus: (event) => this.handleFocus(event, 'to'), onBlur: (event) => this.handleBlur(event, 'to') })),
|
|
2770
|
+
React.createElement(FlexSpacer, null),
|
|
2771
|
+
React.createElement(LinkButton, { isDisabled: !this.state.inputValue.from && !this.state.inputValue.to, caption: i18n.pickerModal.clearAllButton, onClick: this.handleCancel })))));
|
|
2772
|
+
}
|
|
2773
|
+
render() {
|
|
2774
|
+
return this.renderBody();
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
function FilterNumericBody(props) {
|
|
2779
|
+
var _a, _b;
|
|
2780
|
+
const isInRangePredicate = (props === null || props === void 0 ? void 0 : props.selectedPredicate) === 'inRange' || (props === null || props === void 0 ? void 0 : props.selectedPredicate) === 'notInRange';
|
|
2781
|
+
const rangeValueHandler = (type) => (val) => {
|
|
2782
|
+
var _a, _b;
|
|
2783
|
+
const value = props.value;
|
|
2784
|
+
switch (type) {
|
|
2785
|
+
case 'from': {
|
|
2786
|
+
props.onValueChange({
|
|
2787
|
+
from: val,
|
|
2788
|
+
to: (_a = value === null || value === void 0 ? void 0 : value.to) !== null && _a !== void 0 ? _a : null,
|
|
2789
|
+
});
|
|
2790
|
+
break;
|
|
2791
|
+
}
|
|
2792
|
+
case 'to': {
|
|
2793
|
+
props.onValueChange({
|
|
2794
|
+
from: (_b = value === null || value === void 0 ? void 0 : value.from) !== null && _b !== void 0 ? _b : null,
|
|
2795
|
+
to: val,
|
|
2796
|
+
});
|
|
2797
|
+
break;
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
};
|
|
2801
|
+
const renderFooter = () => {
|
|
2802
|
+
const size = isMobile() ? '48' : '36';
|
|
2803
|
+
const clearSelection = () => {
|
|
2804
|
+
if (isInRangePredicate) {
|
|
2805
|
+
props.onValueChange({ from: null, to: null });
|
|
2806
|
+
}
|
|
2807
|
+
else {
|
|
2808
|
+
props.onValueChange(null);
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
const isClearDisabled = typeof props.value !== 'number' && typeof props.value !== 'object';
|
|
2812
|
+
return (React__default.createElement(FlexRow, { padding: "12" },
|
|
2813
|
+
React__default.createElement(FlexSpacer, null),
|
|
2814
|
+
React__default.createElement(FlexCell, { width: "auto", alignSelf: "center" },
|
|
2815
|
+
React__default.createElement(LinkButton, { isDisabled: isClearDisabled, size: size, caption: i18n.pickerInput.clearSelectionButtonSingle, onClick: clearSelection }))));
|
|
2816
|
+
};
|
|
2817
|
+
if (isInRangePredicate) {
|
|
2818
|
+
const value = props.value;
|
|
2819
|
+
return (React__default.createElement("div", null,
|
|
2820
|
+
React__default.createElement(FlexRow, { padding: "12", vPadding: "24", alignItems: "center", spacing: "12", borderBottom: true },
|
|
2821
|
+
React__default.createElement(FlexCell, { width: "100%" },
|
|
2822
|
+
React__default.createElement(NumericInput, { value: (_a = value === null || value === void 0 ? void 0 : value.from) !== null && _a !== void 0 ? _a : null, onValueChange: rangeValueHandler('from'), size: "30", placeholder: "Min", formatOptions: { maximumFractionDigits: 2 } })),
|
|
2823
|
+
React__default.createElement(FlexCell, { width: "100%" },
|
|
2824
|
+
React__default.createElement(NumericInput, { value: (_b = value === null || value === void 0 ? void 0 : value.to) !== null && _b !== void 0 ? _b : null, onValueChange: rangeValueHandler('to'), size: "30", placeholder: "Max", formatOptions: { maximumFractionDigits: 2 } }))),
|
|
2825
|
+
renderFooter()));
|
|
2826
|
+
}
|
|
2827
|
+
return (React__default.createElement("div", null,
|
|
2828
|
+
React__default.createElement(FlexRow, { padding: "12", vPadding: "24", alignItems: "center", borderBottom: true },
|
|
2829
|
+
React__default.createElement(FlexCell, { width: 130 },
|
|
2830
|
+
React__default.createElement(NumericInput, { value: typeof props.value === 'number' ? props.value : null, onValueChange: props.onValueChange, size: "30", placeholder: "Enter a number", formatOptions: { maximumFractionDigits: 2 } }))),
|
|
2831
|
+
renderFooter()));
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
function FilterItemBody(props) {
|
|
2835
|
+
switch (props.type) {
|
|
2836
|
+
case 'singlePicker':
|
|
2837
|
+
return React__default.createElement(FilterPickerBody, Object.assign({}, props, { selectionMode: "single", valueType: "id" }));
|
|
2838
|
+
case 'numeric':
|
|
2839
|
+
return React__default.createElement(FilterNumericBody, Object.assign({}, props));
|
|
2840
|
+
case 'multiPicker':
|
|
2841
|
+
return React__default.createElement(FilterPickerBody, Object.assign({}, props, { selectionMode: "multi", valueType: "id" }));
|
|
2842
|
+
case 'datePicker':
|
|
2843
|
+
return React__default.createElement(FilterDataPickerBody, Object.assign({}, props, { format: props.format || 'DD/MM/YYYY' }));
|
|
2844
|
+
case 'rangeDatePicker':
|
|
2845
|
+
return React__default.createElement(FilterRangeDatePickerBody, Object.assign({}, props, { format: props.format || 'DD/MM/YYYY', value: props.value || { from: null, to: null } }));
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
var _path$c;
|
|
2850
|
+
function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
|
|
2851
|
+
var SvgActionDeleteforever12 = function SvgActionDeleteforever12(props, ref) {
|
|
2852
|
+
return /*#__PURE__*/React.createElement("svg", _extends$d({
|
|
2853
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2854
|
+
width: 12,
|
|
2855
|
+
height: 12,
|
|
2856
|
+
viewBox: "0 0 18 18",
|
|
2857
|
+
ref: ref
|
|
2858
|
+
}, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
|
|
2859
|
+
fillRule: "evenodd",
|
|
2860
|
+
d: "M14 6v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6h10zm-3-4 1 1h3v2H3V3h3l1-1h4zm-.24 12.1L9 12.36 7.24 14.1l-1.16-1.16 1.74-1.76-1.78-1.8 1.2-1.18L9 10l1.76-1.8 1.18 1.18-1.76 1.8 1.76 1.76-1.18 1.16z"
|
|
2861
|
+
})));
|
|
2862
|
+
};
|
|
2863
|
+
var ForwardRef$d = /*#__PURE__*/forwardRef(SvgActionDeleteforever12);
|
|
2864
|
+
|
|
2865
|
+
var css$f = {"typography-header":"FiltersPanelItem_typography-header__cxbkP","typography-block":"FiltersPanelItem_typography-block__AI7VG","typography-inline":"FiltersPanelItem_typography-inline__j90GN","typography-16":"FiltersPanelItem_typography-16__h8TGe","typography-14":"FiltersPanelItem_typography-14__xFk8h","typography-12":"FiltersPanelItem_typography-12__5Pmwi","typography-promo":"FiltersPanelItem_typography-promo__-gtw7 FiltersPanelItem_typography-header__cxbkP FiltersPanelItem_typography-block__AI7VG FiltersPanelItem_typography-inline__j90GN","header":"FiltersPanelItem_header__1Ogc3","removeButton":"FiltersPanelItem_removeButton__ykSMB","panel":"FiltersPanelItem_panel__aLA55","typographyHeader":"FiltersPanelItem_typography-header__cxbkP","typographyBlock":"FiltersPanelItem_typography-block__AI7VG","typographyInline":"FiltersPanelItem_typography-inline__j90GN","typography16":"FiltersPanelItem_typography-16__h8TGe","typography14":"FiltersPanelItem_typography-14__xFk8h","typography12":"FiltersPanelItem_typography-12__5Pmwi","typographyPromo":"FiltersPanelItem_typography-promo__-gtw7 FiltersPanelItem_typography-header__cxbkP FiltersPanelItem_typography-block__AI7VG FiltersPanelItem_typography-inline__j90GN"};
|
|
2866
|
+
|
|
2867
|
+
function FiltersToolbarItemImpl(props) {
|
|
2868
|
+
const isPickersType = (props === null || props === void 0 ? void 0 : props.type) === 'multiPicker' || (props === null || props === void 0 ? void 0 : props.type) === 'singlePicker';
|
|
2869
|
+
const isMobileScreen = isMobile();
|
|
2870
|
+
const popperModifiers = useMemo(() => {
|
|
2871
|
+
const modifiers = [
|
|
2872
|
+
{
|
|
2873
|
+
name: 'offset',
|
|
2874
|
+
options: { offset: isPickersType && isMobileScreen ? [0, 0] : [0, 6] },
|
|
2875
|
+
},
|
|
2876
|
+
];
|
|
2877
|
+
if (isPickersType && isMobileScreen) {
|
|
2878
|
+
modifiers.push({
|
|
2879
|
+
name: 'resetTransform',
|
|
2880
|
+
enabled: true,
|
|
2881
|
+
phase: 'beforeWrite',
|
|
2882
|
+
requires: ['computeStyles'],
|
|
2883
|
+
fn: ({ state }) => {
|
|
2884
|
+
state.styles.popper.transform = '';
|
|
2885
|
+
},
|
|
2886
|
+
});
|
|
2887
|
+
}
|
|
2888
|
+
return modifiers;
|
|
2889
|
+
}, [isPickersType]);
|
|
2890
|
+
const getDefaultPredicate = () => {
|
|
2891
|
+
var _a, _b;
|
|
2892
|
+
if (!props.predicates) {
|
|
2893
|
+
return null;
|
|
2894
|
+
}
|
|
2895
|
+
return Object.keys(props.value || {})[0] || ((_a = props.predicates.find((i) => i.isDefault)) === null || _a === void 0 ? void 0 : _a.predicate) || ((_b = props.predicates) === null || _b === void 0 ? void 0 : _b[0].predicate);
|
|
2896
|
+
};
|
|
2897
|
+
const [isOpen, isOpenChange] = useState(props.autoFocus);
|
|
2898
|
+
const [predicate, setPredicate] = useState(getDefaultPredicate());
|
|
2899
|
+
const predicateName = React__default.useMemo(() => predicate && props.predicates.find((p) => p.predicate === predicate).name, [predicate]);
|
|
2900
|
+
const forceUpdate = useForceUpdate();
|
|
2901
|
+
useEffect(() => {
|
|
2902
|
+
if (props.predicates && Object.keys(props.value || {})[0] && Object.keys(props.value || {})[0] !== predicate) {
|
|
2903
|
+
setPredicate(Object.keys(props.value || {})[0]);
|
|
2904
|
+
}
|
|
2905
|
+
}, [props.value]);
|
|
2906
|
+
const onValueChange = useCallback((value) => {
|
|
2907
|
+
if (props.predicates) {
|
|
2908
|
+
props.onValueChange({ [props.field]: { [predicate]: value } });
|
|
2909
|
+
}
|
|
2910
|
+
else {
|
|
2911
|
+
props.onValueChange({ [props.field]: value });
|
|
2912
|
+
}
|
|
2913
|
+
}, [props.field, props.onValueChange]);
|
|
2914
|
+
const removeOnclickHandler = () => {
|
|
2915
|
+
props.removeFilter(props.field);
|
|
2916
|
+
};
|
|
2917
|
+
const changePredicate = (val) => {
|
|
2918
|
+
const isInRange = (p) => p === 'inRange' || p === 'notInRange';
|
|
2919
|
+
if (props.type === 'numeric') {
|
|
2920
|
+
let predicateValue = {
|
|
2921
|
+
[props.field]: { [val]: getValue() },
|
|
2922
|
+
};
|
|
2923
|
+
if (isInRange(val) && !isInRange(predicate)) {
|
|
2924
|
+
// from simple predicate -> to Range
|
|
2925
|
+
predicateValue = { [props.field]: { [val]: { from: null, to: null } } };
|
|
2926
|
+
}
|
|
2927
|
+
else if (!isInRange(val) && isInRange(predicate)) {
|
|
2928
|
+
// from Range -> to simple predicate
|
|
2929
|
+
predicateValue = { [props.field]: { [val]: null } };
|
|
2930
|
+
}
|
|
2931
|
+
props.onValueChange(predicateValue);
|
|
2932
|
+
}
|
|
2933
|
+
else {
|
|
2934
|
+
props.onValueChange({ [props.field]: { [val]: getValue() } });
|
|
2935
|
+
}
|
|
2936
|
+
setPredicate(val);
|
|
2937
|
+
};
|
|
2938
|
+
const renderHeader = () => (React__default.createElement("div", { className: cx(css$f.header) },
|
|
2939
|
+
props.predicates ? (React__default.createElement(MultiSwitch, { items: props.predicates.map((i) => ({ id: i.predicate, caption: i.name })), value: predicate, onValueChange: changePredicate, size: "24" })) : (React__default.createElement(Text, { color: "secondary", fontSize: "12" }, props.title)),
|
|
2940
|
+
!(props === null || props === void 0 ? void 0 : props.isAlwaysVisible) && (React__default.createElement(LinkButton, { cx: css$f.removeButton, caption: i18n.filterToolbar.datePicker.removeCaption, onClick: removeOnclickHandler, size: "24", icon: ForwardRef$d }))));
|
|
2941
|
+
const renderBody = (dropdownProps) => (React__default.createElement(DropdownContainer, Object.assign({}, dropdownProps),
|
|
2942
|
+
React__default.createElement(Panel, { cx: css$f.panel },
|
|
2943
|
+
React__default.createElement(React__default.Fragment, null, isPickersType ? (React__default.createElement(MobileDropdownWrapper, { close: () => isOpenChange(false) },
|
|
2944
|
+
renderHeader(),
|
|
2945
|
+
React__default.createElement(FilterItemBody, Object.assign({}, props, dropdownProps, { selectedPredicate: predicate, value: getValue(), onValueChange: onValueChange })))) : (React__default.createElement(React__default.Fragment, null,
|
|
2946
|
+
renderHeader(),
|
|
2947
|
+
React__default.createElement(FilterItemBody, Object.assign({}, props, dropdownProps, { selectedPredicate: predicate, value: getValue(), onValueChange: onValueChange }))))))));
|
|
2948
|
+
const getValue = () => {
|
|
2949
|
+
var _a;
|
|
2950
|
+
return predicate ? (_a = props.value) === null || _a === void 0 ? void 0 : _a[predicate] : props.value;
|
|
2951
|
+
};
|
|
2952
|
+
const getTogglerValue = () => {
|
|
2953
|
+
const currentValue = getValue();
|
|
2954
|
+
const defaultFormat = 'MMM DD, YYYY';
|
|
2955
|
+
switch (props.type) {
|
|
2956
|
+
case 'multiPicker': {
|
|
2957
|
+
const view = props.dataSource.getView({}, forceUpdate);
|
|
2958
|
+
const postfix = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) > 2 ? ` +${(currentValue.length - 2).toString()} ${i18n.filterToolbar.pickerInput.itemsPlaceholder}` : null;
|
|
2959
|
+
let isLoading = false;
|
|
2960
|
+
const selection = currentValue
|
|
2961
|
+
? currentValue === null || currentValue === void 0 ? void 0 : currentValue.slice(0, 2).map((i) => {
|
|
2962
|
+
const item = view.getById(i, null);
|
|
2963
|
+
isLoading = item.isLoading;
|
|
2964
|
+
return item.isLoading ? React__default.createElement(TextPlaceholder, null) : props.getName ? props.getName(item.value) : item.value.name;
|
|
2965
|
+
})
|
|
2966
|
+
: [i18n.filterToolbar.pickerInput.emptyValueCaption];
|
|
2967
|
+
const selectionText = isLoading ? selection : selection.join(', ');
|
|
2968
|
+
return { selection: selectionText, postfix };
|
|
2969
|
+
}
|
|
2970
|
+
case 'numeric': {
|
|
2971
|
+
const isRangePredicate = predicate === 'inRange' || predicate === 'notInRange';
|
|
2972
|
+
const decimalFormat = (val) => getSeparatedValue(val, { maximumFractionDigits: 2 });
|
|
2973
|
+
if ((isRangePredicate && !currentValue) || (!isRangePredicate && !currentValue && currentValue !== 0)) {
|
|
2974
|
+
return { selection: i18n.filterToolbar.pickerInput.emptyValueCaption };
|
|
2975
|
+
}
|
|
2976
|
+
const selection = isRangePredicate
|
|
2977
|
+
? `${!(currentValue === null || currentValue === void 0 ? void 0 : currentValue.from) && (currentValue === null || currentValue === void 0 ? void 0 : currentValue.from) !== 0 ? 'Min' : decimalFormat(currentValue === null || currentValue === void 0 ? void 0 : currentValue.from)} - ${!(currentValue === null || currentValue === void 0 ? void 0 : currentValue.to) && (currentValue === null || currentValue === void 0 ? void 0 : currentValue.to) !== 0 ? 'Max' : decimalFormat(currentValue === null || currentValue === void 0 ? void 0 : currentValue.to)}`
|
|
2978
|
+
: `${!currentValue && currentValue !== 0 ? 'ALL' : decimalFormat(currentValue)}`;
|
|
2979
|
+
return { selection };
|
|
2980
|
+
}
|
|
2981
|
+
case 'singlePicker': {
|
|
2982
|
+
const view = props.dataSource.getView({}, forceUpdate);
|
|
2983
|
+
const item = currentValue !== null && currentValue !== undefined && view.getById(currentValue, null);
|
|
2984
|
+
if (!item) {
|
|
2985
|
+
return { selection: i18n.filterToolbar.pickerInput.emptyValueCaption };
|
|
2986
|
+
}
|
|
2987
|
+
const selection = item.isLoading ? React__default.createElement(TextPlaceholder, null) : props.getName ? props.getName(item.value) : item.value.name;
|
|
2988
|
+
return { selection };
|
|
2989
|
+
}
|
|
2990
|
+
case 'datePicker': {
|
|
2991
|
+
return { selection: currentValue ? dayjs_minExports(currentValue).format(props.format || defaultFormat) : i18n.filterToolbar.datePicker.placeholder };
|
|
2992
|
+
}
|
|
2993
|
+
case 'rangeDatePicker': {
|
|
2994
|
+
if (!currentValue || (!currentValue.from && !currentValue.to)) {
|
|
2995
|
+
return { selection: i18n.filterToolbar.rangeDatePicker.emptyPickerPlaceholder };
|
|
2996
|
+
}
|
|
2997
|
+
const currentValueFrom = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.from)
|
|
2998
|
+
? dayjs_minExports(currentValue === null || currentValue === void 0 ? void 0 : currentValue.from).format(props.format || defaultFormat)
|
|
2999
|
+
: i18n.filterToolbar.rangeDatePicker.emptyPlaceholderFrom;
|
|
3000
|
+
const currentValueTo = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.to)
|
|
3001
|
+
? dayjs_minExports(currentValue === null || currentValue === void 0 ? void 0 : currentValue.to).format(props.format || defaultFormat)
|
|
3002
|
+
: i18n.filterToolbar.rangeDatePicker.emptyPlaceholderTo;
|
|
3003
|
+
const selection = `${currentValueFrom} - ${currentValueTo}`;
|
|
3004
|
+
return { selection };
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
};
|
|
3008
|
+
const renderTarget = (dropdownProps) => (React__default.createElement(FilterPanelItemToggler, Object.assign({}, dropdownProps, getTogglerValue(), { title: props.title, predicateName: props.value ? predicateName : null, maxWidth: props.type === 'datePicker' || props.type === 'rangeDatePicker' ? null : '300' })));
|
|
3009
|
+
return (React__default.createElement(Dropdown$1, { renderTarget: renderTarget, renderBody: renderBody, closeBodyOnTogglerHidden: !isMobile(), value: isOpen, onValueChange: isOpenChange, modifiers: popperModifiers }));
|
|
3010
|
+
}
|
|
3011
|
+
const FiltersPanelItem = React__default.memo(FiltersToolbarItemImpl);
|
|
3012
|
+
|
|
3013
|
+
var _path$b;
|
|
3014
|
+
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
|
|
3015
|
+
var SvgContentPlusBold18 = function SvgContentPlusBold18(props, ref) {
|
|
3016
|
+
return /*#__PURE__*/React.createElement("svg", _extends$c({
|
|
3017
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3018
|
+
width: 18,
|
|
3019
|
+
height: 18,
|
|
3020
|
+
viewBox: "0 0 18 18",
|
|
3021
|
+
ref: ref
|
|
3022
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
|
|
3023
|
+
d: "M10.5 3h-3v4.5H3v3h4.5V15h3v-4.5H15v-3h-4.5V3z"
|
|
3024
|
+
})));
|
|
3025
|
+
};
|
|
3026
|
+
var ForwardRef$c = /*#__PURE__*/forwardRef(SvgContentPlusBold18);
|
|
3027
|
+
|
|
3028
|
+
const normalizeFilterWithPredicates = (filter) => {
|
|
3029
|
+
if (!filter) {
|
|
3030
|
+
return {};
|
|
3031
|
+
}
|
|
3032
|
+
const result = filter;
|
|
3033
|
+
const keys = Object.keys(filter);
|
|
3034
|
+
for (let n = 0; n < keys.length; n++) {
|
|
3035
|
+
const key = keys[n];
|
|
3036
|
+
const filterValue = filter[key];
|
|
3037
|
+
if (filterValue && typeof filterValue === 'object') {
|
|
3038
|
+
if ('from' in filterValue && 'to' in filterValue) {
|
|
3039
|
+
continue;
|
|
3040
|
+
}
|
|
3041
|
+
if ('in' in filterValue && (!Array.isArray(filterValue.in) || !filterValue.in.length)) {
|
|
3042
|
+
delete filter[key];
|
|
3043
|
+
}
|
|
3044
|
+
if ('nin' in filterValue && (!Array.isArray(filterValue.nin) || !filterValue.nin.length)) {
|
|
3045
|
+
delete filter[key];
|
|
3046
|
+
}
|
|
3047
|
+
if ('inRange' in filterValue) {
|
|
3048
|
+
if (!filterValue.inRange || (!filterValue.inRange.from && !filterValue.inRange.to)) {
|
|
3049
|
+
delete filter[key];
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
if ('notInRange' in filterValue) {
|
|
3053
|
+
if (!filterValue.notInRange || (!filterValue.notInRange.from && !filterValue.notInRange.to)) {
|
|
3054
|
+
delete filter[key];
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
Object.keys(filterValue).forEach((predicate) => {
|
|
3058
|
+
if (filterValue[predicate] === null || filterValue[predicate] === undefined) {
|
|
3059
|
+
delete filter[key];
|
|
3060
|
+
}
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
return result;
|
|
3065
|
+
};
|
|
3066
|
+
function FiltersToolbarImpl(props) {
|
|
3067
|
+
const { filters, tableState, setTableState } = props;
|
|
3068
|
+
const [newFilterId, setNewFilterId] = useState(null);
|
|
3069
|
+
const dataSource = useArrayDataSource({
|
|
3070
|
+
items: filters,
|
|
3071
|
+
getId: (item) => item.field,
|
|
3072
|
+
}, []);
|
|
3073
|
+
const onFiltersChange = (filters) => {
|
|
3074
|
+
var _a;
|
|
3075
|
+
const newConfig = {};
|
|
3076
|
+
const newFilter = {};
|
|
3077
|
+
const sortedOrders = tableState.filtersConfig && sortBy(tableState.filtersConfig, (f) => f === null || f === void 0 ? void 0 : f.order);
|
|
3078
|
+
let order = (sortedOrders === null || sortedOrders === void 0 ? void 0 : sortedOrders.length) ? (_a = sortedOrders[sortedOrders.length - 1]) === null || _a === void 0 ? void 0 : _a.order : null;
|
|
3079
|
+
filters.forEach((filter) => {
|
|
3080
|
+
var _a, _b;
|
|
3081
|
+
const newOrder = ((_b = (_a = tableState === null || tableState === void 0 ? void 0 : tableState.filtersConfig) === null || _a === void 0 ? void 0 : _a[filter === null || filter === void 0 ? void 0 : filter.field]) === null || _b === void 0 ? void 0 : _b.order) || getOrderBetween(order, null);
|
|
3082
|
+
order = newOrder;
|
|
3083
|
+
newConfig[filter.field] = { isVisible: true, order: newOrder };
|
|
3084
|
+
// Remove unselected filters from filter object
|
|
3085
|
+
if (tableState.filter) {
|
|
3086
|
+
newFilter[filter.field] = tableState.filter[filter.field];
|
|
3087
|
+
}
|
|
3088
|
+
});
|
|
3089
|
+
setTableState(Object.assign(Object.assign({}, tableState), { filtersConfig: newConfig, filter: newFilter }));
|
|
3090
|
+
};
|
|
3091
|
+
const handleFilterChange = (newFilter) => {
|
|
3092
|
+
const filter = normalizeFilterWithPredicates(Object.assign(Object.assign({}, tableState.filter), newFilter));
|
|
3093
|
+
setTableState(Object.assign(Object.assign({}, tableState), { filter: filter }));
|
|
3094
|
+
};
|
|
3095
|
+
const removeFilter = (field) => {
|
|
3096
|
+
const filterConfig = Object.assign({}, tableState.filtersConfig);
|
|
3097
|
+
delete filterConfig[field];
|
|
3098
|
+
const filter = Object.assign({}, tableState.filter);
|
|
3099
|
+
delete filter[field];
|
|
3100
|
+
const newTableState = Object.assign(Object.assign({}, tableState), { filtersConfig: filterConfig, filter: filter });
|
|
3101
|
+
setTableState(Object.assign({}, newTableState));
|
|
3102
|
+
};
|
|
3103
|
+
const selectedFilters = useMemo(() => {
|
|
3104
|
+
const filtersConfig = tableState.filtersConfig || {};
|
|
3105
|
+
return filters.filter((filter) => {
|
|
3106
|
+
return filter.isAlwaysVisible || (filtersConfig[filter === null || filter === void 0 ? void 0 : filter.field] ? filtersConfig[filter === null || filter === void 0 ? void 0 : filter.field].isVisible : false);
|
|
3107
|
+
});
|
|
3108
|
+
}, [tableState.filtersConfig, filters]);
|
|
3109
|
+
const sortedActiveFilters = useMemo(() => {
|
|
3110
|
+
return sortBy(selectedFilters, (f) => { var _a, _b; return (_b = (_a = tableState.filtersConfig) === null || _a === void 0 ? void 0 : _a[f.field]) === null || _b === void 0 ? void 0 : _b.order; });
|
|
3111
|
+
}, [filters, tableState.filtersConfig]);
|
|
3112
|
+
const renderAddFilterToggler = useCallback((props) => {
|
|
3113
|
+
return (React__default.createElement(Button, { size: "36", onClick: props.onClick, ref: props.ref, caption: i18n.filterToolbar.addCaption, icon: ForwardRef$c, iconPosition: "left", mode: "ghost", color: "primary" }));
|
|
3114
|
+
}, []);
|
|
3115
|
+
const getRowOptions = useCallback((item) => ({
|
|
3116
|
+
isDisabled: item.isAlwaysVisible,
|
|
3117
|
+
checkbox: {
|
|
3118
|
+
isVisible: true,
|
|
3119
|
+
isDisabled: item.isAlwaysVisible,
|
|
3120
|
+
},
|
|
3121
|
+
}), []);
|
|
3122
|
+
const isAllFiltersAlwaysVisible = props.filters.every((i) => i.isAlwaysVisible);
|
|
3123
|
+
useEffect(() => {
|
|
3124
|
+
// Reset new filter id, after first render with autofocus
|
|
3125
|
+
setNewFilterId(null);
|
|
3126
|
+
}, [newFilterId]);
|
|
3127
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
3128
|
+
sortedActiveFilters.map((f) => {
|
|
3129
|
+
var _a;
|
|
3130
|
+
return (React__default.createElement(FlexCell$1, { width: "auto", key: f.field },
|
|
3131
|
+
React__default.createElement(FiltersPanelItem, Object.assign({}, f, { value: (_a = tableState.filter) === null || _a === void 0 ? void 0 : _a[f.field], onValueChange: handleFilterChange, key: f.field, autoFocus: newFilterId === f.field, removeFilter: removeFilter }))));
|
|
3132
|
+
}),
|
|
3133
|
+
!isAllFiltersAlwaysVisible && (React__default.createElement(PickerInput, { dataSource: dataSource, value: selectedFilters, onValueChange: onFiltersChange, selectionMode: "multi", valueType: "entity", key: newFilterId, renderRow: (props) => (React__default.createElement(DataPickerRow, Object.assign({}, props, { padding: "12", key: props.key, onCheck: (row) => {
|
|
3134
|
+
props.onCheck(row);
|
|
3135
|
+
!row.isChecked && setNewFilterId(row.value.field);
|
|
3136
|
+
}, renderItem: (item, rowProps) => React__default.createElement(PickerItem, Object.assign({}, rowProps, { title: item.title })) }))), getName: (i) => i.title, renderToggler: renderAddFilterToggler, emptyValue: [], getRowOptions: getRowOptions, fixedBodyPosition: true }))));
|
|
3137
|
+
}
|
|
3138
|
+
const FiltersPanel = React__default.memo(FiltersToolbarImpl);
|
|
3139
|
+
|
|
3140
|
+
var css$e = {"divider":"PresetsPanel_divider__jIY7S","dropdownDeleteIcon":"PresetsPanel_dropdownDeleteIcon__58Nc7","presetsWrapper":"PresetsPanel_presetsWrapper__ssv3J","addPresetContainer":"PresetsPanel_addPresetContainer__SLcW-"};
|
|
3141
|
+
|
|
3142
|
+
var css$d = {"preset-dropdown-panel":"PresetActionsDropdown_preset-dropdown-panel__tHjiI","delete-row":"PresetActionsDropdown_delete-row__43HRE","delete-button":"PresetActionsDropdown_delete-button__RZ0Ak","targetOpen":"PresetActionsDropdown_targetOpen__nZyO-","presetDropdownPanel":"PresetActionsDropdown_preset-dropdown-panel__tHjiI","deleteRow":"PresetActionsDropdown_delete-row__43HRE","deleteButton":"PresetActionsDropdown_delete-button__RZ0Ak"};
|
|
3143
|
+
|
|
3144
|
+
var _path$a;
|
|
3145
|
+
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
|
|
3146
|
+
var SvgSaveOutline18 = function SvgSaveOutline18(props, ref) {
|
|
3147
|
+
return /*#__PURE__*/React.createElement("svg", _extends$b({
|
|
3148
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3149
|
+
width: 18,
|
|
3150
|
+
height: 18,
|
|
3151
|
+
viewBox: "0 0 18 18",
|
|
3152
|
+
ref: ref
|
|
3153
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
3154
|
+
d: "M12.75 2.25h-9a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5v-9l-3-3zm1.5 12H3.75V3.75h8.377l2.123 2.122v8.378zM9 9a2.247 2.247 0 0 0-2.25 2.25A2.247 2.247 0 0 0 9 13.5a2.247 2.247 0 0 0 2.25-2.25A2.247 2.247 0 0 0 9 9zM4.5 4.5h6.75v3H4.5v-3z"
|
|
3155
|
+
})));
|
|
3156
|
+
};
|
|
3157
|
+
var ForwardRef$b = /*#__PURE__*/forwardRef(SvgSaveOutline18);
|
|
3158
|
+
|
|
3159
|
+
var _path$9;
|
|
3160
|
+
function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
|
|
3161
|
+
var SvgContentEditUndo18 = function SvgContentEditUndo18(props, ref) {
|
|
3162
|
+
return /*#__PURE__*/React.createElement("svg", _extends$a({
|
|
3163
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3164
|
+
width: 18,
|
|
3165
|
+
height: 18,
|
|
3166
|
+
viewBox: "0 0 18 18",
|
|
3167
|
+
ref: ref
|
|
3168
|
+
}, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
|
|
3169
|
+
fillRule: "evenodd",
|
|
3170
|
+
d: "M9.375 6A7.848 7.848 0 0 0 4.2 7.95l-2.7-2.7V12h6.75L5.535 9.285a5.965 5.965 0 0 1 3.84-1.41 6.009 6.009 0 0 1 5.7 4.125l1.777-.585C15.81 8.273 12.862 6 9.375 6z",
|
|
3171
|
+
clipRule: "evenodd"
|
|
3172
|
+
})));
|
|
3173
|
+
};
|
|
3174
|
+
var ForwardRef$a = /*#__PURE__*/forwardRef(SvgContentEditUndo18);
|
|
3175
|
+
|
|
3176
|
+
var _path$8;
|
|
3177
|
+
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
|
|
3178
|
+
var SvgActionCopyContent18 = function SvgActionCopyContent18(props, ref) {
|
|
3179
|
+
return /*#__PURE__*/React.createElement("svg", _extends$9({
|
|
3180
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3181
|
+
width: 18,
|
|
3182
|
+
height: 18,
|
|
3183
|
+
viewBox: "0 0 18 18",
|
|
3184
|
+
ref: ref
|
|
3185
|
+
}, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
|
|
3186
|
+
fillRule: "evenodd",
|
|
3187
|
+
d: "M3 1h8v2H3v8H1V3a2 2 0 0 1 2-2zm2 6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7zm10 8H7V7h8v8z",
|
|
3188
|
+
clipRule: "evenodd"
|
|
3189
|
+
})));
|
|
3190
|
+
};
|
|
3191
|
+
var ForwardRef$9 = /*#__PURE__*/forwardRef(SvgActionCopyContent18);
|
|
3192
|
+
|
|
3193
|
+
var _path$7;
|
|
3194
|
+
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
|
|
3195
|
+
var SvgContentEdit18 = function SvgContentEdit18(props, ref) {
|
|
3196
|
+
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
3197
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3198
|
+
width: 18,
|
|
3199
|
+
height: 18,
|
|
3200
|
+
viewBox: "0 0 18 18",
|
|
3201
|
+
ref: ref
|
|
3202
|
+
}, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
|
|
3203
|
+
fillRule: "evenodd",
|
|
3204
|
+
d: "M2.25 12.94v2.812h2.813l8.294-8.295-2.812-2.813L2.25 12.94zm13.283-7.658a.747.747 0 0 0 0-1.058L13.777 2.47a.747.747 0 0 0-1.058 0l-1.373 1.373 2.813 2.812 1.373-1.372z",
|
|
3205
|
+
clipRule: "evenodd"
|
|
3206
|
+
})));
|
|
3207
|
+
};
|
|
3208
|
+
var ForwardRef$8 = /*#__PURE__*/forwardRef(SvgContentEdit18);
|
|
3209
|
+
|
|
3210
|
+
var _path$6;
|
|
3211
|
+
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
|
|
3212
|
+
var SvgContentLink18 = function SvgContentLink18(props, ref) {
|
|
3213
|
+
return /*#__PURE__*/React.createElement("svg", _extends$7({
|
|
3214
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3215
|
+
width: 18,
|
|
3216
|
+
height: 18,
|
|
3217
|
+
viewBox: "0 0 18 18",
|
|
3218
|
+
ref: ref
|
|
3219
|
+
}, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
|
|
3220
|
+
fillRule: "evenodd",
|
|
3221
|
+
d: "M7.943 10.057a.73.73 0 0 1 0 1.066.756.756 0 0 1-1.065 0 3.753 3.753 0 0 1 0-5.303l2.655-2.655a3.753 3.753 0 0 1 5.302 0 3.753 3.753 0 0 1 0 5.302l-1.118 1.118a5.18 5.18 0 0 0-.3-1.815l.353-.36a2.236 2.236 0 0 0 0-3.18 2.236 2.236 0 0 0-3.18 0L7.943 6.877a2.236 2.236 0 0 0 0 3.18zm2.114-3.18a.756.756 0 0 1 1.066 0 3.753 3.753 0 0 1 0 5.303l-2.655 2.655a3.753 3.753 0 0 1-5.303 0 3.753 3.753 0 0 1 0-5.303l1.118-1.117a5.25 5.25 0 0 0 .3 1.823l-.353.352a2.236 2.236 0 0 0 0 3.18 2.236 2.236 0 0 0 3.18 0l2.647-2.647a2.236 2.236 0 0 0 0-3.18.73.73 0 0 1 0-1.066z",
|
|
3222
|
+
clipRule: "evenodd"
|
|
3223
|
+
})));
|
|
3224
|
+
};
|
|
3225
|
+
var ForwardRef$7 = /*#__PURE__*/forwardRef(SvgContentLink18);
|
|
3226
|
+
|
|
3227
|
+
var _path$5;
|
|
3228
|
+
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
|
|
3229
|
+
var SvgActionDeleteforever18 = function SvgActionDeleteforever18(props, ref) {
|
|
3230
|
+
return /*#__PURE__*/React.createElement("svg", _extends$6({
|
|
3231
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3232
|
+
width: 18,
|
|
3233
|
+
height: 18,
|
|
3234
|
+
viewBox: "0 0 18 18",
|
|
3235
|
+
ref: ref
|
|
3236
|
+
}, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
|
|
3237
|
+
fillRule: "evenodd",
|
|
3238
|
+
d: "M7 2h4l1 1h3v2H3V3h3l1-1zM4 6h10v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6zm6.76 8.1L9 12.36 7.24 14.1l-1.16-1.16 1.74-1.76-1.78-1.8 1.2-1.18L9 10l1.76-1.8 1.18 1.18-1.76 1.8 1.76 1.76-1.18 1.16z",
|
|
3239
|
+
clipRule: "evenodd"
|
|
3240
|
+
})));
|
|
3241
|
+
};
|
|
3242
|
+
var ForwardRef$6 = /*#__PURE__*/forwardRef(SvgActionDeleteforever18);
|
|
3243
|
+
|
|
3244
|
+
function PresetActionsDropdown(props) {
|
|
3245
|
+
const { uuiNotifications } = useUuiContext();
|
|
3246
|
+
const copyUrlToClipboard = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
3247
|
+
yield navigator.clipboard.writeText(props.getPresetLink(props.preset));
|
|
3248
|
+
successNotificationHandler('Link copied!');
|
|
3249
|
+
}), []);
|
|
3250
|
+
const saveInCurrent = useCallback((preset) => __awaiter(this, void 0, void 0, function* () {
|
|
3251
|
+
const newPreset = Object.assign(Object.assign({}, preset), { filter: props.tableState.filter, sorting: props.tableState.sorting, columnsConfig: props.tableState.columnsConfig, filtersConfig: props.tableState.filtersConfig, viewState: props.tableState.viewState });
|
|
3252
|
+
yield props.updatePreset(newPreset);
|
|
3253
|
+
successNotificationHandler('Changes saved!');
|
|
3254
|
+
}), [
|
|
3255
|
+
props.tableState.filter, props.tableState.columnsConfig, props.tableState.filtersConfig,
|
|
3256
|
+
]);
|
|
3257
|
+
const successNotificationHandler = useCallback((text) => {
|
|
3258
|
+
uuiNotifications
|
|
3259
|
+
.show((props) => (React__default.createElement(SuccessNotification, Object.assign({}, props),
|
|
3260
|
+
React__default.createElement(Text, { size: "36", font: "regular", fontSize: "14" }, text))), { duration: 3 })
|
|
3261
|
+
.catch(() => null);
|
|
3262
|
+
}, []);
|
|
3263
|
+
const saveInCurrentHandler = useCallback(() => {
|
|
3264
|
+
saveInCurrent(props.preset);
|
|
3265
|
+
}, [props.preset]);
|
|
3266
|
+
const discardAllChangesHandler = useCallback(() => {
|
|
3267
|
+
props.choosePreset(props.preset);
|
|
3268
|
+
}, [props.preset]);
|
|
3269
|
+
const duplicateHandler = useCallback(() => {
|
|
3270
|
+
props.duplicatePreset(props.preset);
|
|
3271
|
+
}, [props.preset]);
|
|
3272
|
+
const deleteHandler = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
3273
|
+
yield props.deletePreset(props.preset);
|
|
3274
|
+
}), [
|
|
3275
|
+
props.activePresetId, props.deletePreset, props.preset,
|
|
3276
|
+
]);
|
|
3277
|
+
const renderBody = () => {
|
|
3278
|
+
const isReadonlyPreset = props.preset.isReadonly;
|
|
3279
|
+
return (React__default.createElement(Panel, { shadow: true, cx: css$d.presetDropdownPanel },
|
|
3280
|
+
props.activePresetId === props.preset.id && props.hasPresetChanged(props.preset) && (React__default.createElement(React__default.Fragment, null,
|
|
3281
|
+
!isReadonlyPreset && (React__default.createElement(FlexRow, { key: `${props.preset.id}-save-in-current` },
|
|
3282
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$p, caption: "Save in current", onClick: saveInCurrentHandler }))),
|
|
3283
|
+
React__default.createElement(FlexRow, { key: `${props.preset.id}-save-as-new` },
|
|
3284
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$b, caption: "Save as new", onClick: props.addPreset })),
|
|
3285
|
+
React__default.createElement(FlexRow, { key: `${props.preset.id}-discard`, borderBottom: true },
|
|
3286
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$a, caption: "Discard all changes", onClick: discardAllChangesHandler })))),
|
|
3287
|
+
props.preset.id === props.activePresetId && !isReadonlyPreset && (React__default.createElement(FlexRow, { key: `${props.preset.id}-rename` },
|
|
3288
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$8, caption: "Rename", onClick: props.renamePreset }))),
|
|
3289
|
+
React__default.createElement(FlexRow, { key: `${props.preset.id}-duplicate` },
|
|
3290
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$9, caption: "Duplicate", onClick: duplicateHandler })),
|
|
3291
|
+
React__default.createElement(FlexRow, { borderBottom: true, key: `${props.preset.id}-copyLink` },
|
|
3292
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$7, caption: "Copy Link", onClick: copyUrlToClipboard })),
|
|
3293
|
+
!isReadonlyPreset && (React__default.createElement(FlexRow, { key: `${props.preset.id}-delete`, cx: css$d.deleteRow },
|
|
3294
|
+
React__default.createElement(DropdownMenuButton, { icon: ForwardRef$6, caption: "Delete", cx: css$d.deleteButton, onClick: deleteHandler })))));
|
|
3295
|
+
};
|
|
3296
|
+
const renderTarget = useCallback((dropdownProps) => {
|
|
3297
|
+
return (React__default.createElement(IconButton, Object.assign({ cx: dropdownProps.isOpen && css$d.targetOpen, color: props.preset.id === props.activePresetId ? 'info' : 'default' }, dropdownProps, { icon: ForwardRef$q })));
|
|
3298
|
+
}, []);
|
|
3299
|
+
return (React__default.createElement(Dropdown, { renderBody: renderBody, renderTarget: renderTarget, placement: "bottom-end", modifiers: [{ name: 'offset', options: { offset: [0, 22] } }] }));
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
var css$c = {"preset-input-cell":"PresetInput_preset-input-cell__PInCC","preset-input":"PresetInput_preset-input__vBBRA","presetInputCell":"PresetInput_preset-input-cell__PInCC","presetInput":"PresetInput_preset-input__vBBRA"};
|
|
3303
|
+
|
|
3304
|
+
function PresetInput(props) {
|
|
3305
|
+
var _a;
|
|
3306
|
+
const [presetCaption, setPresetCaption] = useState(((_a = props.preset) === null || _a === void 0 ? void 0 : _a.name) || '');
|
|
3307
|
+
const cancelActionHandler = useCallback(() => {
|
|
3308
|
+
setPresetCaption('');
|
|
3309
|
+
props.onCancel();
|
|
3310
|
+
}, [props.onCancel]);
|
|
3311
|
+
const acceptActionHandler = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
3312
|
+
if (presetCaption) {
|
|
3313
|
+
yield props.onSuccess(presetCaption);
|
|
3314
|
+
}
|
|
3315
|
+
props.onCancel();
|
|
3316
|
+
}), [presetCaption]);
|
|
3317
|
+
const newPresetOnBlurHandler = useCallback(() => {
|
|
3318
|
+
if (presetCaption.length) {
|
|
3319
|
+
return;
|
|
3320
|
+
}
|
|
3321
|
+
props.onCancel();
|
|
3322
|
+
}, [presetCaption.length, props.onCancel]);
|
|
3323
|
+
return (React__default.createElement(FlexCell, { cx: css$c.presetInputCell, minWidth: 180 },
|
|
3324
|
+
React__default.createElement(TextInput, { cx: css$c.presetInput, onValueChange: setPresetCaption, value: presetCaption, onCancel: cancelActionHandler, onAccept: acceptActionHandler, onBlur: newPresetOnBlurHandler, autoFocus: true })));
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
var css$b = {"preset":"Preset_preset__aitu-","activePreset":"Preset_activePreset__SFqmD"};
|
|
3328
|
+
|
|
3329
|
+
function Preset(props) {
|
|
3330
|
+
const [isRenamePreset, setIsRenamePreset] = useState(false);
|
|
3331
|
+
const choosePresetHandler = useCallback(() => props.choosePreset(props.preset), [props]);
|
|
3332
|
+
const cancelRenamePreset = useCallback(() => {
|
|
3333
|
+
setIsRenamePreset(() => false);
|
|
3334
|
+
}, []);
|
|
3335
|
+
const setPresetForRename = useCallback(() => {
|
|
3336
|
+
if (!isRenamePreset) {
|
|
3337
|
+
setIsRenamePreset(() => true);
|
|
3338
|
+
}
|
|
3339
|
+
}, []);
|
|
3340
|
+
const handlePresetRename = useCallback((name) => {
|
|
3341
|
+
const newPreset = Object.assign(Object.assign({}, props.preset), { name: name });
|
|
3342
|
+
return props.updatePreset(newPreset);
|
|
3343
|
+
}, [props.preset]);
|
|
3344
|
+
const isPresetActive = props.activePresetId === props.preset.id;
|
|
3345
|
+
return (React__default.createElement(FlexCell, { key: props.preset.id, alignSelf: "center", width: "auto" }, isRenamePreset ? (React__default.createElement(PresetInput, { onCancel: cancelRenamePreset, onSuccess: handlePresetRename, preset: props.preset })) : (React__default.createElement(TabButton, { caption: props.preset.name, onClick: !isPresetActive && choosePresetHandler, cx: [css$b.preset, isPresetActive && css$b.activePreset], size: "60", withNotify: isPresetActive && props.hasPresetChanged(props.preset), icon: () => React__default.createElement(PresetActionsDropdown, Object.assign({ renamePreset: setPresetForRename }, props)), iconPosition: "right", isLinkActive: isPresetActive }))));
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
function PresetsPanel(props) {
|
|
3349
|
+
const [isAddingPreset, setIsAddingPreset] = useState(false);
|
|
3350
|
+
const setAddingPreset = useCallback(() => {
|
|
3351
|
+
setIsAddingPreset(true);
|
|
3352
|
+
}, []);
|
|
3353
|
+
const cancelAddingPreset = useCallback(() => {
|
|
3354
|
+
setIsAddingPreset(false);
|
|
3355
|
+
}, []);
|
|
3356
|
+
const presetApi = __rest(props, ["presets"]);
|
|
3357
|
+
const renderPreset = (preset) => {
|
|
3358
|
+
return React__default.createElement(Preset, Object.assign({ key: preset.id, preset: preset, addPreset: setAddingPreset }, presetApi));
|
|
3359
|
+
};
|
|
3360
|
+
const renderAddPresetButton = useCallback(() => {
|
|
3361
|
+
return (React__default.createElement("div", { key: "addingPresetBlock", className: css$e.addPresetContainer }, !isAddingPreset ? (React__default.createElement(Button, { size: "36", onClick: setAddingPreset, caption: i18n.presetPanel.addCaption, icon: ForwardRef$c, iconPosition: "left", mode: "ghost", color: "primary" })) : (React__default.createElement(PresetInput, { onCancel: cancelAddingPreset, onSuccess: props.createNewPreset }))));
|
|
3362
|
+
}, [isAddingPreset]);
|
|
3363
|
+
const onPresetDropdownSelect = (preset) => {
|
|
3364
|
+
props.choosePreset(preset.preset);
|
|
3365
|
+
props.updatePreset(preset.preset);
|
|
3366
|
+
};
|
|
3367
|
+
const renderMoreButtonDropdown = (item, hiddenItems) => {
|
|
3368
|
+
return (React__default.createElement(Dropdown, { key: "more", renderTarget: (props) => (React__default.createElement(FlexRow, null,
|
|
3369
|
+
React__default.createElement("div", { className: css$e.divider }),
|
|
3370
|
+
React__default.createElement(Button, Object.assign({ mode: "ghost", color: "secondary", caption: `${(hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.length) || ''} more` }, props)))), renderBody: () => (React__default.createElement(DropdownContainer, { width: 230 }, hiddenItems.map((item) => (React__default.createElement(DropdownMenuButton, { key: item.preset.id, onClick: () => onPresetDropdownSelect(item), caption: item.preset.name, icon: !item.preset.isReadonly && ForwardRef$6, iconPosition: "right", cx: css$e.dropdownDeleteIcon, onIconClick: !item.preset.isReadonly && (() => props.deletePreset(item.preset)) }))))) }));
|
|
3371
|
+
};
|
|
3372
|
+
const getPresetPriority = (preset, index) => {
|
|
3373
|
+
return preset.id === props.activePresetId ? 100499 : 1000 - index;
|
|
3374
|
+
};
|
|
3375
|
+
const getPanelItems = () => {
|
|
3376
|
+
return [
|
|
3377
|
+
...sortBy(props.presets, (i) => i.order).map((preset, index) => ({
|
|
3378
|
+
id: preset.id.toString(),
|
|
3379
|
+
render: () => renderPreset(preset),
|
|
3380
|
+
priority: getPresetPriority(preset, index),
|
|
3381
|
+
preset: preset,
|
|
3382
|
+
})), {
|
|
3383
|
+
id: 'collapsedContainer', render: renderMoreButtonDropdown, priority: 100501, collapsedContainer: true,
|
|
3384
|
+
}, { id: 'addPreset', render: renderAddPresetButton, priority: 100501 },
|
|
3385
|
+
];
|
|
3386
|
+
};
|
|
3387
|
+
return (React__default.createElement(FlexCell, { grow: 1, minWidth: 310, rawProps: props.rawProps },
|
|
3388
|
+
React__default.createElement(FlexRow, { size: null, spacing: "12", cx: css$e.presetsWrapper },
|
|
3389
|
+
React__default.createElement(AdaptivePanel, { items: getPanelItems() }))));
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
const defaultPredicates = {
|
|
3393
|
+
numeric: [
|
|
3394
|
+
{ predicate: 'eq', name: '=', isDefault: true }, { predicate: 'neq', name: '≠' }, { predicate: 'lte', name: '≤' }, { predicate: 'gte', name: '≥' }, { predicate: 'inRange', name: 'In Range' },
|
|
3395
|
+
],
|
|
3396
|
+
multiPicker: [{ predicate: 'in', name: 'is', isDefault: true }, { predicate: 'nin', name: 'is not' }],
|
|
3397
|
+
rangeDatePicker: [{ predicate: 'inRange', name: 'In Range', isDefault: true }, { predicate: 'notInRange', name: 'Not in Range' }],
|
|
3398
|
+
};
|
|
3399
|
+
|
|
3400
|
+
var css$a = {"root":"MainMenu_root__39Kfw"};
|
|
3401
|
+
|
|
3402
|
+
function applyMainMenuMods() {
|
|
3403
|
+
return [css$a.root];
|
|
3404
|
+
}
|
|
3405
|
+
const MainMenu = withMods(MainMenu$1, applyMainMenuMods, () => ({
|
|
3406
|
+
Burger,
|
|
3407
|
+
MainMenuDropdown,
|
|
3408
|
+
}));
|
|
3409
|
+
|
|
3410
|
+
var _path$4;
|
|
3411
|
+
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
|
|
3412
|
+
var SvgGlobalMenu = function SvgGlobalMenu(props, ref) {
|
|
3413
|
+
return /*#__PURE__*/React.createElement("svg", _extends$5({
|
|
3414
|
+
width: 60,
|
|
3415
|
+
height: 60,
|
|
3416
|
+
viewBox: "0 0 24 24",
|
|
3417
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3418
|
+
ref: ref
|
|
3419
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
3420
|
+
className: "cls-2",
|
|
3421
|
+
d: "M12 11.2a.8.8 0 1 1-.8.8.8.8 0 0 1 .8-.8zm3.2 0a.8.8 0 1 1-.8.8.802.802 0 0 1 .8-.8zm-6.4 0a.8.8 0 1 1-.8.8.8.8 0 0 1 .8-.8zM12 7.6a.8.8 0 1 1-.8.8.8.8 0 0 1 .8-.8zm3.2 0a.8.8 0 1 1-.8.8.802.802 0 0 1 .8-.8zm-6.4 0a.8.8 0 1 1-.8.8.8.8 0 0 1 .8-.8zm3.2 7.2a.8.8 0 1 1-.8.8.8.8 0 0 1 .8-.8zm3.2 0a.8.8 0 1 1-.8.8.802.802 0 0 1 .8-.8zm-6.4 0a.8.8 0 1 1-.8.8.8.8 0 0 1 .8-.8z"
|
|
3422
|
+
})));
|
|
3423
|
+
};
|
|
3424
|
+
var ForwardRef$5 = /*#__PURE__*/forwardRef(SvgGlobalMenu);
|
|
3425
|
+
|
|
3426
|
+
var css$9 = {"global-menu-btn":"GlobalMenu_global-menu-btn__QdXAw","globalMenuIcon":"GlobalMenu_globalMenuIcon__62mij","globalMenuBtn":"GlobalMenu_global-menu-btn__QdXAw"};
|
|
3427
|
+
|
|
3428
|
+
const GlobalMenu = React.forwardRef((props, ref) => (React.createElement("button", Object.assign({ ref: ref, id: "global_menu_toggle", className: cx(css$9.globalMenuBtn, props.cx) }, props.rawProps),
|
|
3429
|
+
React.createElement(IconContainer, { icon: ForwardRef$5, cx: css$9.globalMenuIcon }))));
|
|
3430
|
+
|
|
3431
|
+
var css$8 = {"root":"Burger_root__euW9D","burger-content":"Burger_burger-content__4ssSJ","burgerContent":"Burger_burger-content__4ssSJ"};
|
|
3432
|
+
|
|
3433
|
+
var _path$3;
|
|
3434
|
+
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
|
|
3435
|
+
var SvgBurger = function SvgBurger(props, ref) {
|
|
3436
|
+
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
3437
|
+
width: 60,
|
|
3438
|
+
height: 60,
|
|
3439
|
+
viewBox: "0 0 24 24",
|
|
3440
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3441
|
+
ref: ref
|
|
3442
|
+
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
|
3443
|
+
d: "M8 9.2h8v.8H8zM8 14h6v.8H8zm0-2.4h8v.8H8z"
|
|
3444
|
+
})));
|
|
3445
|
+
};
|
|
3446
|
+
var ForwardRef$4 = /*#__PURE__*/forwardRef(SvgBurger);
|
|
3447
|
+
|
|
3448
|
+
var _path$2;
|
|
3449
|
+
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
3450
|
+
var SvgBurgerClose = function SvgBurgerClose(props, ref) {
|
|
3451
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
3452
|
+
width: 60,
|
|
3453
|
+
height: 60,
|
|
3454
|
+
viewBox: "0 0 60 60",
|
|
3455
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3456
|
+
ref: ref
|
|
3457
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
3458
|
+
d: "M38.543 20 40 21.457 31.456 30 40 38.543 38.543 40 30 31.456 21.457 40 20 38.543 28.543 30 20 21.457 21.457 20 30 28.543 38.543 20Z"
|
|
3459
|
+
})));
|
|
3460
|
+
};
|
|
3461
|
+
var ForwardRef$3 = /*#__PURE__*/forwardRef(SvgBurgerClose);
|
|
3462
|
+
|
|
3463
|
+
function applyBurgerMods() {
|
|
3464
|
+
return [css$8.root];
|
|
3465
|
+
}
|
|
3466
|
+
const Burger = withMods(Burger$1, applyBurgerMods, () => ({
|
|
3467
|
+
burgerIcon: ForwardRef$4,
|
|
3468
|
+
crossIcon: ForwardRef$3,
|
|
3469
|
+
burgerContentCx: css$8.burgerContent,
|
|
3470
|
+
}));
|
|
3471
|
+
|
|
3472
|
+
var _g, _path$1;
|
|
3473
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
3474
|
+
var SvgTriangle = function SvgTriangle(props, ref) {
|
|
3475
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
3476
|
+
width: 12,
|
|
3477
|
+
height: 24,
|
|
3478
|
+
viewBox: "0 0 12 24",
|
|
3479
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3480
|
+
ref: ref
|
|
3481
|
+
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
3482
|
+
transform: "translate(0 -290.65)",
|
|
3483
|
+
fill: "none",
|
|
3484
|
+
stroke: "#000",
|
|
3485
|
+
strokeWidth: 0.05
|
|
3486
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3487
|
+
d: "M-6 284.65h36v36H-6z"
|
|
3488
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
3489
|
+
cx: 12,
|
|
3490
|
+
cy: 302.65,
|
|
3491
|
+
r: 18
|
|
3492
|
+
}))), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
3493
|
+
d: "m5 14-4-4h8z"
|
|
3494
|
+
})));
|
|
3495
|
+
};
|
|
3496
|
+
var ForwardRef$2 = /*#__PURE__*/forwardRef(SvgTriangle);
|
|
3497
|
+
|
|
3498
|
+
var css$7 = {"typography-header":"BurgerButton_typography-header__U1Ojg","typography-block":"BurgerButton_typography-block__-fzNQ","typography-inline":"BurgerButton_typography-inline__Q7e9n","typography-16":"BurgerButton_typography-16__yCkJk","typography-14":"BurgerButton_typography-14__Oe153","typography-12":"BurgerButton_typography-12__Lfcud","typography-promo":"BurgerButton_typography-promo__4LGMX BurgerButton_typography-header__U1Ojg BurgerButton_typography-block__-fzNQ BurgerButton_typography-inline__Q7e9n","root":"BurgerButton_root__FLwMS","button-primary":"BurgerButton_button-primary__CJHtP","button-secondary":"BurgerButton_button-secondary__6Aa0H","hasIcon":"BurgerButton_hasIcon__-Hrg6","dropdown":"BurgerButton_dropdown__TUqjg","typographyHeader":"BurgerButton_typography-header__U1Ojg","typographyBlock":"BurgerButton_typography-block__-fzNQ","typographyInline":"BurgerButton_typography-inline__Q7e9n","typography16":"BurgerButton_typography-16__yCkJk","typography14":"BurgerButton_typography-14__Oe153","typography12":"BurgerButton_typography-12__Lfcud","typographyPromo":"BurgerButton_typography-promo__4LGMX BurgerButton_typography-header__U1Ojg BurgerButton_typography-block__-fzNQ BurgerButton_typography-inline__Q7e9n","buttonPrimary":"BurgerButton_button-primary__CJHtP","buttonSecondary":"BurgerButton_button-secondary__6Aa0H"};
|
|
3499
|
+
|
|
3500
|
+
const BurgerButton = withMods(Button$1, (props) => [
|
|
3501
|
+
css$7.root, css$7['button-' + (props.type || 'primary')], css$7['indent-' + (props.indentLevel || 0)], props.isDropdown && css$7.dropdown, props.icon && css$7.hasIcon,
|
|
3502
|
+
], () => ({ dropdownIcon: ForwardRef$2, dropdownIconPosition: 'left', role: 'menuitem' }));
|
|
3503
|
+
|
|
3504
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
3505
|
+
var SvgMenuInputCancel = function SvgMenuInputCancel(props, ref) {
|
|
3506
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
3507
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3508
|
+
width: 18,
|
|
3509
|
+
height: 24,
|
|
3510
|
+
viewBox: "0 0 18 24",
|
|
3511
|
+
ref: ref
|
|
3512
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
3513
|
+
style: {
|
|
3514
|
+
display: "inline"
|
|
3515
|
+
}
|
|
3516
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3517
|
+
style: {
|
|
3518
|
+
opacity: 1,
|
|
3519
|
+
fill: "none",
|
|
3520
|
+
fillOpacity: 1,
|
|
3521
|
+
stroke: "none",
|
|
3522
|
+
strokeWidth: 0.39687493,
|
|
3523
|
+
strokeMiterlimit: 4,
|
|
3524
|
+
strokeDasharray: "none",
|
|
3525
|
+
strokeOpacity: 1
|
|
3526
|
+
},
|
|
3527
|
+
d: "M95.25 170h9.525v9.525H95.25z",
|
|
3528
|
+
transform: "matrix(3.77953 0 0 3.77953 -369 -648.52)"
|
|
3529
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3530
|
+
style: {
|
|
3531
|
+
opacity: 1,
|
|
3532
|
+
vectorEffect: "none",
|
|
3533
|
+
fillOpacity: 1,
|
|
3534
|
+
fillRule: "nonzero",
|
|
3535
|
+
stroke: "none",
|
|
3536
|
+
strokeWidth: 0.26458335,
|
|
3537
|
+
strokeLinecap: "butt",
|
|
3538
|
+
strokeLinejoin: "miter",
|
|
3539
|
+
strokeMiterlimit: 4,
|
|
3540
|
+
strokeDasharray: "none",
|
|
3541
|
+
strokeDashoffset: 0,
|
|
3542
|
+
strokeOpacity: 1
|
|
3543
|
+
},
|
|
3544
|
+
d: "m100.76 173.64-.748.748-.748-.748-.374.374.748.748-.748.749.374.374.748-.748.749.748.374-.374-.748-.749.748-.748z",
|
|
3545
|
+
transform: "matrix(3.77953 0 0 3.77953 -369 -648.52)"
|
|
3546
|
+
})));
|
|
3547
|
+
};
|
|
3548
|
+
var ForwardRef$1 = /*#__PURE__*/forwardRef(SvgMenuInputCancel);
|
|
3549
|
+
|
|
3550
|
+
var css$6 = {"search-input":"BurgerSearch_search-input__pTnno","searchInput":"BurgerSearch_search-input__pTnno"};
|
|
3551
|
+
|
|
3552
|
+
function BurgerSearch(props) {
|
|
3553
|
+
return (React.createElement(TextInput$1, { cx: css$6.searchInput, iconPosition: "left", icon: ForwardRef$W, placeholder: props.placeholder, value: props.value, onValueChange: props.onValueChange, onCancel: props.onCancel, cancelIcon: props.value && ForwardRef$1, autoFocus: true }));
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
var css$5 = {"group-header":"BurgerGroupHeader_group-header__3i4ay","group-name":"BurgerGroupHeader_group-name__szcRq","line":"BurgerGroupHeader_line__oAhHd","groupHeader":"BurgerGroupHeader_group-header__3i4ay","groupName":"BurgerGroupHeader_group-name__szcRq"};
|
|
3557
|
+
|
|
3558
|
+
function BurgerGroupHeader(props) {
|
|
3559
|
+
return (React.createElement("div", { className: css$5.groupHeader },
|
|
3560
|
+
React.createElement("hr", { className: css$5.line }),
|
|
3561
|
+
React.createElement("span", { className: css$5.groupName }, props.caption)));
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
var css$4 = {"container":"MainMenuAvatar_container__vT8rb","open":"MainMenuAvatar_open__S2acz"};
|
|
3565
|
+
|
|
3566
|
+
const MainMenuAvatar = React.forwardRef((props, ref) => (React.createElement("button", { ref: ref, className: cx(css$4.container, props.isDropdown && css$4.dropdown, props.isOpen && css$4.open, props.onClick && uuiMarkers.clickable, props.cx), onClick: props.onClick },
|
|
3567
|
+
React.createElement(Avatar$1, { size: "36", img: props.avatarUrl }),
|
|
3568
|
+
props.icon && React.createElement(IconContainer, { icon: props.icon }),
|
|
3569
|
+
props.isDropdown && (React.createElement("div", null,
|
|
3570
|
+
React.createElement(IconContainer, { icon: ForwardRef$10, flipY: props.isOpen }))))));
|
|
3571
|
+
|
|
3572
|
+
var css$3 = {"search-input":"MainMenuSearch_search-input__xTdYX","searchInput":"MainMenuSearch_search-input__xTdYX"};
|
|
3573
|
+
|
|
3574
|
+
const MainMenuSearch = React.forwardRef((props, ref) => (React.createElement(IEditableDebouncer, Object.assign({}, props, { render: (iEditable) => {
|
|
3575
|
+
var _a;
|
|
3576
|
+
return (React.createElement(TextInput$1, Object.assign({ iconPosition: "left", icon: ForwardRef$W, cancelIcon: ((_a = props.value) === null || _a === void 0 ? void 0 : _a.length) > 0 && ForwardRef$1 }, props, iEditable, { ref: ref, cx: cx$1(css$3.searchInput, props.cx) }, props.rawProps)));
|
|
3577
|
+
} }))));
|
|
3578
|
+
|
|
3579
|
+
var css$2 = {"container":"MainMenuIcon_container__s-83v"};
|
|
3580
|
+
|
|
3581
|
+
const MainMenuIcon = React.forwardRef((props, ref) => (React.createElement(IconButton, Object.assign({ ref: ref, icon: props.icon, cx: cx$1(props.cx, css$2.container) }, props))));
|
|
3582
|
+
|
|
3583
|
+
var css$1 = {"typography-header":"MainMenuButton_typography-header__pWBln","typography-block":"MainMenuButton_typography-block__yRJgj","typography-inline":"MainMenuButton_typography-inline__dABqt","typography-16":"MainMenuButton_typography-16__Qsux4","typography-14":"MainMenuButton_typography-14__Xy5hg","typography-12":"MainMenuButton_typography-12__QTtay","typography-promo":"MainMenuButton_typography-promo__8AGoE MainMenuButton_typography-header__pWBln MainMenuButton_typography-block__yRJgj MainMenuButton_typography-inline__dABqt","root":"MainMenuButton_root__182y5","type-primary":"MainMenuButton_type-primary__pzpis","type-secondary":"MainMenuButton_type-secondary__bUETW","typographyHeader":"MainMenuButton_typography-header__pWBln","typographyBlock":"MainMenuButton_typography-block__yRJgj","typographyInline":"MainMenuButton_typography-inline__dABqt","typography16":"MainMenuButton_typography-16__Qsux4","typography14":"MainMenuButton_typography-14__Xy5hg","typography12":"MainMenuButton_typography-12__QTtay","typographyPromo":"MainMenuButton_typography-promo__8AGoE MainMenuButton_typography-header__pWBln MainMenuButton_typography-block__yRJgj MainMenuButton_typography-inline__dABqt","typePrimary":"MainMenuButton_type-primary__pzpis","typeSecondary":"MainMenuButton_type-secondary__bUETW"};
|
|
3584
|
+
|
|
3585
|
+
var _path;
|
|
3586
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3587
|
+
var SvgChevronDown24 = function SvgChevronDown24(props, ref) {
|
|
3588
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
3589
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3590
|
+
width: 24,
|
|
3591
|
+
height: 24,
|
|
3592
|
+
viewBox: "0 0 24 24",
|
|
3593
|
+
ref: ref
|
|
3594
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
3595
|
+
fillRule: "evenodd",
|
|
3596
|
+
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
3597
|
+
})));
|
|
3598
|
+
};
|
|
3599
|
+
var ForwardRef = /*#__PURE__*/forwardRef(SvgChevronDown24);
|
|
3600
|
+
|
|
3601
|
+
const MainMenuButton = withMods(Button$1, (mods) => [css$1.root, css$1['type-' + (mods.type || 'primary')]], () => ({ dropdownIcon: ForwardRef, role: 'menuitem' }));
|
|
3602
|
+
|
|
3603
|
+
var css = {"dropdown-body":"MainMenuDropdown_dropdown-body__k9qxb","dropdownBody":"MainMenuDropdown_dropdown-body__k9qxb"};
|
|
3604
|
+
|
|
3605
|
+
class MainMenuDropdown extends React.Component {
|
|
3606
|
+
render() {
|
|
3607
|
+
return (React.createElement(Dropdown$1, { renderTarget: (props) => (React.createElement(MainMenuButton, Object.assign({ caption: this.props.caption }, props, { rawProps: this.props.rawProps, isLinkActive: this.props.isLinkActive, isDropdown: true }))), renderBody: (props) => {
|
|
3608
|
+
return (React.createElement("div", { className: cx(css.dropdownBody) }, this.props.renderBody
|
|
3609
|
+
? this.props.renderBody(Object.assign({}, props))
|
|
3610
|
+
: React.Children.map(this.props.children, (item) => {
|
|
3611
|
+
if (!item)
|
|
3612
|
+
return item;
|
|
3613
|
+
return React.createElement(item.type, Object.assign(Object.assign({}, item.props), { onClick: item.props.onClick
|
|
3614
|
+
? () => {
|
|
3615
|
+
item.props.onClick();
|
|
3616
|
+
props.onClose();
|
|
3617
|
+
}
|
|
3618
|
+
: null }));
|
|
3619
|
+
})));
|
|
3620
|
+
}, placement: "bottom-start" }));
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
const Anchor = Anchor$1;
|
|
3625
|
+
|
|
3626
|
+
function Form(props) {
|
|
3627
|
+
const context = useUuiContext();
|
|
3628
|
+
const beforeLeave = () => {
|
|
3629
|
+
return context.uuiModals.show((modalProps) => React.createElement(ConfirmationModal, Object.assign({ caption: i18n.form.modals.beforeLeaveMessage }, modalProps)));
|
|
3630
|
+
};
|
|
3631
|
+
const loadUnsavedChanges = () => {
|
|
3632
|
+
return context.uuiNotifications
|
|
3633
|
+
.show((props) => (React.createElement(WarningNotification, Object.assign({}, props, { actions: [
|
|
3634
|
+
{
|
|
3635
|
+
name: i18n.form.notifications.actionButtonCaption,
|
|
3636
|
+
action: props.onSuccess,
|
|
3637
|
+
},
|
|
3638
|
+
] }),
|
|
3639
|
+
React.createElement(RichTextView, null,
|
|
3640
|
+
React.createElement(Text, { size: "36" }, i18n.form.notifications.unsavedChangesMessage)))), { duration: 5, position: 'bot-left' })
|
|
3641
|
+
.catch(() => null);
|
|
3642
|
+
};
|
|
3643
|
+
return React.createElement(Form$1, Object.assign({ loadUnsavedChanges: loadUnsavedChanges, beforeLeave: beforeLeave }, props));
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
function useForm(props) {
|
|
3647
|
+
const context = useUuiContext();
|
|
3648
|
+
const beforeLeave = () => {
|
|
3649
|
+
return context.uuiModals.show((modalProps) => React__default.createElement(ConfirmationModal, Object.assign({ caption: i18n.form.modals.beforeLeaveMessage }, modalProps)));
|
|
3650
|
+
};
|
|
3651
|
+
const loadUnsavedChanges = () => {
|
|
3652
|
+
return context.uuiNotifications.show((props) => (React__default.createElement(WarningNotification, Object.assign({}, props, { actions: [
|
|
3653
|
+
{
|
|
3654
|
+
name: i18n.form.notifications.actionButtonCaption,
|
|
3655
|
+
action: props.onSuccess,
|
|
3656
|
+
},
|
|
3657
|
+
] }),
|
|
3658
|
+
React__default.createElement(RichTextView, null,
|
|
3659
|
+
React__default.createElement(Text, { size: "36" }, i18n.form.notifications.unsavedChangesMessage)))), { duration: 5, position: 'bot-left' });
|
|
3660
|
+
};
|
|
3661
|
+
return useForm$1(Object.assign({ beforeLeave, loadUnsavedChanges }, props));
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
export { Accordion, Alert, Anchor, Avatar, AvatarStack, Badge, Blocker, Burger, BurgerButton, BurgerGroupHeader, BurgerSearch, Button, Calendar, Checkbox, CheckboxGroup, ClearNotification, ColumnHeaderDropdown, ColumnsConfigurationModal, ConfirmationModal, ControlGroup, DataPickerBody, DataPickerFooter, DataPickerHeader, DataPickerRow, DataTable, DataTableCell, DataTableHeaderCell, DataTableHeaderRow, DataTableRow, DatePicker, DatePickerBody, DropMarker, Dropdown, DropdownContainer, DropdownMenuBody, DropdownMenuButton, DropdownMenuHeader, DropdownMenuSplitter, DropdownMenuSwitchButton, DropdownSubMenu, EditMode, ErrorAlert, ErrorNotification, FilterItemBody, FiltersPanel, FlexCell, FlexRow, Form, GlobalMenu, HintAlert, HintNotification, IDropdownControlKeys, IconButton, LabeledInput, LinkButton, MainMenu, MainMenuAvatar, MainMenuButton, MainMenuDropdown, MainMenuIcon, MainMenuSearch, MobileDropdownWrapper, ModalBlocker, ModalFooter, ModalHeader, ModalWindow, MultiSwitch, NotificationCard, NumericInput, Paginator, Panel, PickerInput, PickerItem, PickerList, PickerListItem, PickerModal, PickerModalImpl, PickerToggler, PresetsPanel, RadioGroup, RadioInput, RangeDatePicker, RangeDatePickerBody, RichTextView, ScrollBars, SearchInput, Spinner, SuccessAlert, SuccessNotification, Switch, TabButton, Tag, Text, TextArea, TextInput, TextPlaceholder, Tooltip, VerticalTabButton, VirtualList, WarningAlert, WarningNotification, allButtonColors, allButtonModes, allButtonSemanticColors, allEpamBadgeSemanticColors, allFillStyles, allFontStyles, allIconColors, allRowSizes, allSemanticColors, allSizes, allTextSizes, applyBadgeMods, applyButtonMods, applyCheckboxMods, applyDatePickerBodyMods, applyDateSelectionMods, applyNumericInputMods, applyRangeDatePickerBodyMods, applySpinnerMods, applySwitchMods, applyTagMods, applyTextAreaMods, applyTextInputMods, defaultPredicates, getTextClasses, i18n, propsMods, renderCell, renderDropMarkers, useColumnsWithFilters, useForm };
|
|
3665
|
+
//# sourceMappingURL=index.esm.js.map
|