hrm_ui_lib 2.0.0-alpha.2 → 2.0.0-alpha.21
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/{Alert-w8FkRd9I.js → Alert--0rz5XL1.js} +22 -14
- package/assets/images/under-construction.svg +9 -0
- package/assets/styles/styles.css +4459 -4533
- package/assets/styles/styles.scss +1 -3
- package/components/Alert/Alert.js +12 -10
- package/components/Alert/index.js +6 -4
- package/components/Avatar/Avatar.js +7 -5
- package/components/Avatar/AvatarGroup.js +6 -4
- package/components/Avatar/index.js +6 -4
- package/components/BadgeV2/BadgeV2.d.ts +2 -2
- package/components/BadgeV2/BadgeV2.js +20 -8
- package/components/BadgeV2/types.d.ts +5 -2
- package/components/Button/Button.js +6 -4
- package/components/Button/index.js +6 -4
- package/components/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/components/ButtonGroup/ButtonGroup.js +46 -0
- package/components/ButtonGroup/ButtonGroupItem.d.ts +2 -0
- package/components/ButtonGroup/ButtonGroupItem.js +52 -0
- package/components/ButtonGroup/consts.d.ts +8 -0
- package/components/ButtonGroup/consts.js +12 -0
- package/components/ButtonGroup/index.d.ts +1 -0
- package/components/ButtonGroup/index.js +10 -0
- package/components/ButtonGroup/types.d.ts +23 -0
- package/components/ButtonGroup/types.js +1 -0
- package/components/Card/Card.d.ts +5 -2
- package/components/Card/Card.js +58 -7
- package/components/Card/CardComponent/Card.js +4 -3
- package/components/Card/CardComponent/CardBody.d.ts +1 -1
- package/components/Card/CardComponent/CardBody.js +5 -5
- package/components/Card/CardComponent/CardFooter.d.ts +4 -0
- package/components/Card/CardComponent/CardFooter.js +13 -0
- package/components/Card/CardComponent/CardHead.js +67 -5
- package/components/Card/index.js +48 -2
- package/components/Card/types.d.ts +3 -0
- package/components/CardGroup/CardGroup.d.ts +10 -0
- package/components/CardGroup/CardGroup.js +27 -0
- package/components/CardGroup/CardGroupComponent/CardBody.d.ts +4 -0
- package/components/CardGroup/CardGroupComponent/CardBody.js +19 -0
- package/components/CardGroup/CardGroupComponent/CardGroup.d.ts +4 -0
- package/components/CardGroup/CardGroupComponent/CardGroup.js +28 -0
- package/components/CardGroup/CardGroupComponent/CardHead.d.ts +4 -0
- package/components/CardGroup/CardGroupComponent/CardHead.js +19 -0
- package/components/CardGroup/CardGroupContext.d.ts +6 -0
- package/components/CardGroup/CardGroupContext.js +8 -0
- package/components/CardGroup/index.d.ts +1 -0
- package/components/CardGroup/index.js +11 -0
- package/components/CardGroup/types.d.ts +14 -0
- package/components/CardGroup/types.js +1 -0
- package/components/Checkbox/Checkbox.js +11 -9
- package/components/Checkbox/index.js +6 -4
- package/components/Checkbox/types.d.ts +1 -0
- package/components/Collapse/Collapse/Collapse.js +2 -2
- package/components/Collapse/CollapseGroup/CollapseGroup.js +1 -1
- package/components/Collapse/CollapseItem/CollapseItem.js +1 -1
- package/components/Collapse/index.js +1 -1
- package/components/Collapse/types.d.ts +1 -1
- package/components/Copy/Copy.js +6 -4
- package/components/Copy/index.js +6 -4
- package/components/Counter/Counter.js +6 -4
- package/components/Counter/index.js +6 -4
- package/components/DatePicker/CustomHeader/CustomHeader.js +7 -5
- package/components/DatePicker/RangeDatePicker/RangeDatePicker.js +12 -4
- package/components/DatePicker/RangeDatePicker/RangeDatePickerDesktop.js +12 -4
- package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +12 -4
- package/components/DatePicker/RangeDatePicker/index.js +12 -4
- package/components/DatePicker/SimpleDatePicker/SimpleDatePicker.js +12 -4
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js +12 -4
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +12 -4
- package/components/DatePicker/SimpleDatePicker/index.js +12 -4
- package/components/DatePicker/TimePicker/MobileModalContent.js +7 -4
- package/components/DatePicker/TimePicker/TimePicker.js +14 -5
- package/components/DatePicker/TimePicker/TimePickerDesktop.js +13 -7
- package/components/DatePicker/TimePicker/TimePickerMobile.js +8 -5
- package/components/DatePicker/TimePicker/index.js +14 -5
- package/components/DatePicker/hooks.js +8 -2139
- package/components/DatePicker/index.js +14 -5
- package/components/Divider/Divider.js +6 -3
- package/components/Divider/types.d.ts +1 -0
- package/components/Empty/Empty.js +6 -4
- package/components/Empty/index.js +6 -4
- package/components/FileUpload/DropzoneFileUpload/DropzoneFileUpload.js +6 -4
- package/components/FileUpload/DropzoneFileUpload/ErrorItem.js +6 -4
- package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +14 -12
- package/components/FileUpload/DropzoneFileUpload/helpers.js +6 -4
- package/components/FileUpload/DropzoneFileUpload/index.js +6 -4
- package/components/FileUpload/FileUpload.js +7 -5
- package/components/FileUpload/UploadItems.js +7 -5
- package/components/FileUpload/index.js +7 -5
- package/components/FormContainer/FormContainer.js +22 -12
- package/components/FormContainer/index.js +7 -5
- package/components/FormContainer/types.d.ts +1 -0
- package/components/FormField/FormField.js +6 -4
- package/components/FormField/index.js +7 -5
- package/components/IconDynamicComponent/IconDynamicComponent.d.ts +8 -0
- package/components/IconDynamicComponent/IconDynamicComponent.js +39 -0
- package/{helperComponents → components}/IconDynamicComponent/index.js +1 -1
- package/components/Input/Input.js +6 -4
- package/components/Input/index.js +6 -4
- package/components/Menu/Menu.js +7 -5
- package/components/Menu/NestedMenu.js +7 -5
- package/components/Menu/index.js +7 -5
- package/components/Modal/Modal.js +6 -4
- package/components/Modal/ModalConfirmation.js +6 -4
- package/components/Modal/ModalContent.js +6 -4
- package/components/Modal/index.js +6 -4
- package/components/More/More.js +6 -4
- package/components/More/index.js +6 -4
- package/components/Popover/Popover.js +6 -4
- package/components/Popover/PopoverDesktop.js +1 -1
- package/components/Popover/PopoverMobile.js +6 -4
- package/components/Popover/index.js +6 -4
- package/components/Popover/types.d.ts +2 -1
- package/components/Radio/RadioGroup.js +7 -5
- package/components/Radio/index.js +7 -5
- package/components/SVGIcons/IconAirplaneTakeOff.d.ts +4 -0
- package/components/SVGIcons/IconAirplaneTakeOff.js +29 -0
- package/components/SVGIcons/IconAirplaneTakeOffFilled.d.ts +4 -0
- package/components/SVGIcons/IconAirplaneTakeOffFilled.js +29 -0
- package/components/SVGIcons/IconChartPerson.d.ts +4 -0
- package/components/SVGIcons/IconChartPerson.js +29 -0
- package/components/SVGIcons/IconChartPersonFilled.d.ts +4 -0
- package/components/SVGIcons/IconChartPersonFilled.js +29 -0
- package/components/SVGIcons/IconFastAcceleration.d.ts +4 -0
- package/components/SVGIcons/IconFastAcceleration.js +29 -0
- package/components/SVGIcons/IconFastAccelerationFilled.d.ts +4 -0
- package/components/SVGIcons/IconFastAccelerationFilled.js +29 -0
- package/components/SVGIcons/IconFeed.d.ts +4 -0
- package/components/SVGIcons/IconFeed.js +29 -0
- package/components/SVGIcons/IconFeedFilled.d.ts +4 -0
- package/components/SVGIcons/IconFeedFilled.js +29 -0
- package/components/SVGIcons/IconLibrary.d.ts +4 -0
- package/components/SVGIcons/IconLibrary.js +29 -0
- package/components/SVGIcons/IconLibraryFilled.d.ts +4 -0
- package/components/SVGIcons/IconLibraryFilled.js +29 -0
- package/components/SVGIcons/IconPeopleList.d.ts +4 -0
- package/components/SVGIcons/IconPeopleList.js +29 -0
- package/components/SVGIcons/IconPeopleListFilled.d.ts +4 -0
- package/components/SVGIcons/IconPeopleListFilled.js +29 -0
- package/components/SVGIcons/IconPeopleTeam.d.ts +4 -0
- package/components/SVGIcons/IconPeopleTeam.js +29 -0
- package/components/SVGIcons/IconPeopleTeamFilled.d.ts +4 -0
- package/components/SVGIcons/IconPeopleTeamFilled.js +29 -0
- package/components/SVGIcons/IconTrophy.d.ts +4 -0
- package/components/SVGIcons/IconTrophy.js +29 -0
- package/components/SVGIcons/IconTrophyFilled.d.ts +4 -0
- package/components/SVGIcons/IconTrophyFilled.js +29 -0
- package/components/SVGIcons/IconUs.d.ts +4 -0
- package/components/SVGIcons/IconUs.js +72 -0
- package/components/SVGIcons/icon-names.d.ts +2 -0
- package/components/SVGIcons/icon-names.js +3 -0
- package/components/SVGIcons/index.d.ts +19 -2
- package/components/SVGIcons/index.js +19 -2
- package/components/Select/ButtonSelect/ButtonSelect.js +7 -5
- package/components/Select/FilterSelect/FilterDropdown.js +7 -5
- package/components/Select/FilterSelect/FilterGroupDropdown.js +6 -4
- package/components/Select/FilterSelect/FilterSelect.js +6 -4
- package/components/Select/MultiSelect/MobileWrapper.js +6 -4
- package/components/Select/MultiSelect/MultiBase/MultiBase.js +7 -5
- package/components/Select/MultiSelect/MultiSelect.js +6 -4
- package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +7 -5
- package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +7 -5
- package/components/Select/MultiSelect/OptionsWrapper.js +6 -4
- package/components/Select/NestedSelect/NestedSelect.js +7 -5
- package/components/Select/Select/Select.js +6 -4
- package/components/Select/Select/SelectDesktop/index.js +7 -5
- package/components/Select/Select/SelectMobile/MobileTopContent.js +6 -4
- package/components/Select/Select/SelectMobile/index.js +7 -5
- package/components/Select/SharedComponents/Actions.js +7 -5
- package/components/Select/SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js +8 -6
- package/components/Select/SharedComponents/ContentTop.js +6 -4
- package/components/Select/SharedComponents/Footer.js +6 -4
- package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +6 -4
- package/components/Select/SharedComponents/index.js +6 -4
- package/components/Select/index.js +6 -4
- package/components/SideSheet/Footer/Footer.js +6 -4
- package/components/SideSheet/SideSheet.js +6 -4
- package/components/SideSheet/index.js +6 -4
- package/components/Snackbar/Snackbar.js +14 -12
- package/components/Snackbar/index.js +6 -4
- package/components/Switcher/Switcher.js +27 -19
- package/components/Switcher/index.js +7 -6
- package/components/Switcher/types.d.ts +2 -0
- package/components/Tab/Tab.js +4 -2
- package/components/Table/Header.d.ts +2 -1
- package/components/Table/Header.js +19 -8
- package/components/Table/IndeterminateCheckbox.d.ts +1 -0
- package/components/Table/IndeterminateCheckbox.js +12 -6
- package/components/Table/Row.d.ts +2 -1
- package/components/Table/Row.js +24 -9
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +60 -17
- package/components/Table/index.js +8 -4
- package/components/Table/localization.d.ts +5 -0
- package/components/Table/localization.js +13 -0
- package/components/Table/types.d.ts +6 -0
- package/components/Table/utils.js +36 -8
- package/components/TableV2/AdvancedPagination.js +9 -7
- package/components/TableV2/ColumnSettings.js +8 -6
- package/components/TableV2/IndeterminateCheckbox.js +6 -4
- package/components/TableV2/Table.js +7 -4
- package/components/TableV2/hooks/useTableControl.js +20 -15
- package/components/TableV2/index.js +8 -5
- package/components/Text/types.d.ts +1 -1
- package/components/Textarea/Textarea.js +6 -4
- package/components/Textarea/index.js +6 -4
- package/components/Tooltip/types.d.ts +0 -1
- package/components/UnderConstruction/UnderConstruction.d.ts +3 -0
- package/components/UnderConstruction/UnderConstruction.js +38 -0
- package/components/UnderConstruction/index.d.ts +1 -0
- package/components/UnderConstruction/index.js +8 -0
- package/components/UnderConstruction/localization.d.ts +4 -0
- package/components/UnderConstruction/localization.js +16 -0
- package/components/UnderConstruction/types.d.ts +12 -0
- package/components/UnderConstruction/types.js +1 -0
- package/helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js +1 -1
- package/helperComponents/AnimatePresenceWrapper/index.js +1 -1
- package/helperComponents/CodeBlock/CodeBlock.js +1 -154
- package/helperComponents/CodeBlock/index.js +1 -0
- package/helperComponents/ErrorMessage/ErrorMessage.js +2 -2
- package/helperComponents/ErrorMessage/index.js +2 -2
- package/helperComponents/GoToWebPage/GoToWebPage.js +6 -4
- package/helperComponents/OptionItem/OptionItem.js +7 -5
- package/helperComponents/OptionItem/index.js +6 -4
- package/helperComponents/index.d.ts +0 -1
- package/helperComponents/index.js +7 -5
- package/helpers/check-authorization.js +8 -6
- package/helpers/format-date.js +1 -22
- package/helpers/index.js +6 -4
- package/hooks/useHideOnScroll.d.ts +1 -1
- package/hooks/useHideOnScroll.js +5 -4
- package/i18n.d.ts +4 -0
- package/i18n.js +50 -0
- package/index.d.ts +3 -0
- package/index.js +46 -7
- package/package.json +6 -5
- package/helperComponents/IconDynamicComponent/IconDynamicComponent.d.ts +0 -9
- package/helperComponents/IconDynamicComponent/IconDynamicComponent.js +0 -26
- package/helperComponents/IconDynamicComponent/constants.d.ts +0 -3
- package/helperComponents/IconDynamicComponent/constants.js +0 -33
- /package/{helperComponents → components}/IconDynamicComponent/index.d.ts +0 -0
package/components/Tab/Tab.js
CHANGED
|
@@ -17,7 +17,9 @@ var Tab = function Tab(props) {
|
|
|
17
17
|
className = props.className,
|
|
18
18
|
rest = _objectWithoutProperties(props, _excluded);
|
|
19
19
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className:
|
|
20
|
+
className: "tabs-container"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: classNames('tabs-header-container', className)
|
|
21
23
|
}, tabItems.map(function (tabInfo) {
|
|
22
24
|
return /*#__PURE__*/React.createElement(TabItem, _extends({
|
|
23
25
|
label: tabInfo.label,
|
|
@@ -31,7 +33,7 @@ var Tab = function Tab(props) {
|
|
|
31
33
|
dataId: (tabInfo === null || tabInfo === void 0 ? void 0 : tabInfo.dataId) || '',
|
|
32
34
|
disabled: tabInfo.disabled
|
|
33
35
|
}, rest));
|
|
34
|
-
}));
|
|
36
|
+
})));
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
export { Tab };
|
|
@@ -5,6 +5,7 @@ type Props = {
|
|
|
5
5
|
withSelect: boolean;
|
|
6
6
|
tableWidth: number;
|
|
7
7
|
headerGroup: HeaderGroup;
|
|
8
|
+
uniqueKey: string;
|
|
8
9
|
};
|
|
9
|
-
export declare function Header({ headerGroup, tableWidth, withSelect, fixedHeader }: Props): ReactElement;
|
|
10
|
+
export declare function Header({ headerGroup, tableWidth, withSelect, uniqueKey, fixedHeader }: Props): ReactElement;
|
|
10
11
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/extends';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import { CHECKBOX_DEFAULT_WIDTH, calcColumnWidth, CHECKBOX_HEADER_ID } from './utils.js';
|
|
@@ -8,9 +9,8 @@ import { IconArrowDown } from '../SVGIcons/IconArrowDown.js';
|
|
|
8
9
|
import { IconArrowUp } from '../SVGIcons/IconArrowUp.js';
|
|
9
10
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
10
11
|
import './IndeterminateCheckbox.js';
|
|
11
|
-
import '../../Alert
|
|
12
|
+
import '../../Alert--0rz5XL1.js';
|
|
12
13
|
import '../Alert/consts.js';
|
|
13
|
-
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
14
14
|
import 'dayjs';
|
|
15
15
|
import '../../helperComponents/Loader/Loader.js';
|
|
16
16
|
import '@babel/runtime/helpers/slicedToArray';
|
|
@@ -22,12 +22,13 @@ import 'react-dropzone';
|
|
|
22
22
|
import '../SVGIcons/IconUpload.js';
|
|
23
23
|
import '../FileUpload/types.js';
|
|
24
24
|
import '../../helpers/format-date.js';
|
|
25
|
+
import 'dayjs/plugin/utc';
|
|
25
26
|
import '../../helpers/locale.js';
|
|
26
27
|
import '../../type/locale.js';
|
|
27
28
|
import '../../helpers/storage.js';
|
|
28
29
|
import 'react-toastify';
|
|
29
30
|
import '../../hooks/useGetIsMobile.js';
|
|
30
|
-
import '
|
|
31
|
+
import 'motion/react';
|
|
31
32
|
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
32
33
|
import '../../hooks/useOnOutsideClick.js';
|
|
33
34
|
import '../../hooks/useHideBodyScroll.js';
|
|
@@ -41,11 +42,12 @@ import '../../hooks/useGetTooltipPosition.js';
|
|
|
41
42
|
import '../../hooks/useHideOnScroll.js';
|
|
42
43
|
import '../../utils/helpers.js';
|
|
43
44
|
import 'react-syntax-highlighter';
|
|
45
|
+
import 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
44
46
|
import '../Link/Link.js';
|
|
45
47
|
import '../Popover/PopoverDesktop.js';
|
|
46
48
|
import '../SVGIcons/IconInfo.js';
|
|
47
|
-
import '
|
|
48
|
-
import '
|
|
49
|
+
import '../IconDynamicComponent/IconDynamicComponent.js';
|
|
50
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
49
51
|
import '@babel/runtime/helpers/typeof';
|
|
50
52
|
import '../SVGIcons/IconDismissFilled.js';
|
|
51
53
|
import '../SVGIcons/IconDelete.js';
|
|
@@ -55,15 +57,21 @@ import '../SVGIcons/IconArrowDownloadFilled.js';
|
|
|
55
57
|
import '../../helpers/download-file.js';
|
|
56
58
|
import '../Button/consts.js';
|
|
57
59
|
|
|
60
|
+
var _excluded = ["key"],
|
|
61
|
+
_excluded2 = ["key"];
|
|
58
62
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
59
63
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
60
64
|
function Header(_ref) {
|
|
61
65
|
var headerGroup = _ref.headerGroup,
|
|
62
66
|
tableWidth = _ref.tableWidth,
|
|
63
67
|
withSelect = _ref.withSelect,
|
|
68
|
+
uniqueKey = _ref.uniqueKey,
|
|
64
69
|
_ref$fixedHeader = _ref.fixedHeader,
|
|
65
70
|
fixedHeader = _ref$fixedHeader === void 0 ? false : _ref$fixedHeader;
|
|
66
|
-
|
|
71
|
+
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps();
|
|
72
|
+
_headerGroup$getHeade.key;
|
|
73
|
+
var headerGroupProps = _objectWithoutProperties(_headerGroup$getHeade, _excluded);
|
|
74
|
+
return /*#__PURE__*/React.createElement("tr", _extends({}, headerGroupProps, {
|
|
67
75
|
className: classNames({
|
|
68
76
|
fixed_header: fixedHeader
|
|
69
77
|
})
|
|
@@ -92,9 +100,12 @@ function Header(_ref) {
|
|
|
92
100
|
} : {}), !isSelection && width ? {
|
|
93
101
|
width: width
|
|
94
102
|
} : {});
|
|
103
|
+
var _getHeaderProps = getHeaderProps(columnProps !== null && columnProps !== void 0 && columnProps.sortable ? getSortByToggleProps() : undefined);
|
|
104
|
+
_getHeaderProps.key;
|
|
105
|
+
var headProps = _objectWithoutProperties(_getHeaderProps, _excluded2);
|
|
95
106
|
return /*#__PURE__*/React.createElement("th", _extends({
|
|
96
|
-
key: i
|
|
97
|
-
},
|
|
107
|
+
key: "table_head_".concat(uniqueKey, "_").concat(i)
|
|
108
|
+
}, headProps, {
|
|
98
109
|
className: classNames({
|
|
99
110
|
fixed_column_left: fixed === 'left',
|
|
100
111
|
fixed_column_right: fixed === 'right',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useEffect } from 'react';
|
|
2
|
-
import { C as Checkbox } from '../../Alert
|
|
2
|
+
import { C as Checkbox } from '../../Alert--0rz5XL1.js';
|
|
3
3
|
import '@babel/runtime/helpers/extends';
|
|
4
4
|
import '../Alert/consts.js';
|
|
5
5
|
import 'classnames';
|
|
@@ -19,12 +19,13 @@ import 'react-dropzone';
|
|
|
19
19
|
import '../SVGIcons/IconUpload.js';
|
|
20
20
|
import '../FileUpload/types.js';
|
|
21
21
|
import '../../helpers/format-date.js';
|
|
22
|
+
import 'dayjs/plugin/utc';
|
|
22
23
|
import '../../helpers/locale.js';
|
|
23
24
|
import '../../type/locale.js';
|
|
24
25
|
import '../../helpers/storage.js';
|
|
25
26
|
import 'react-toastify';
|
|
26
27
|
import '../../hooks/useGetIsMobile.js';
|
|
27
|
-
import '
|
|
28
|
+
import 'motion/react';
|
|
28
29
|
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
29
30
|
import '../../hooks/useOnOutsideClick.js';
|
|
30
31
|
import '../../hooks/useHideBodyScroll.js';
|
|
@@ -37,11 +38,12 @@ import '../../hooks/useGetElemPositions.js';
|
|
|
37
38
|
import '../../hooks/useGetTooltipPosition.js';
|
|
38
39
|
import '../../hooks/useHideOnScroll.js';
|
|
39
40
|
import 'react-syntax-highlighter';
|
|
41
|
+
import 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
40
42
|
import '../Link/Link.js';
|
|
41
43
|
import '../Popover/PopoverDesktop.js';
|
|
42
44
|
import '../SVGIcons/IconInfo.js';
|
|
43
|
-
import '
|
|
44
|
-
import '
|
|
45
|
+
import '../IconDynamicComponent/IconDynamicComponent.js';
|
|
46
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
45
47
|
import '@babel/runtime/helpers/typeof';
|
|
46
48
|
import '../SVGIcons/IconDismissFilled.js';
|
|
47
49
|
import '../SVGIcons/IconDelete.js';
|
|
@@ -54,7 +56,9 @@ import '../Button/consts.js';
|
|
|
54
56
|
var IndeterminateCheckbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
55
57
|
var indeterminate = _ref.indeterminate,
|
|
56
58
|
checked = _ref.checked,
|
|
57
|
-
onChange = _ref.onChange
|
|
59
|
+
onChange = _ref.onChange,
|
|
60
|
+
_ref$disabled = _ref.disabled,
|
|
61
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
58
62
|
var defaultRef = useRef(null);
|
|
59
63
|
var resolvedRef = ref || defaultRef;
|
|
60
64
|
useEffect(function () {
|
|
@@ -68,9 +72,11 @@ var IndeterminateCheckbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
68
72
|
});
|
|
69
73
|
};
|
|
70
74
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
75
|
+
disabled: disabled,
|
|
71
76
|
value: checked,
|
|
72
77
|
onClick: handleChange,
|
|
73
|
-
ref: resolvedRef
|
|
78
|
+
ref: resolvedRef,
|
|
79
|
+
stopPropagation: true
|
|
74
80
|
});
|
|
75
81
|
});
|
|
76
82
|
IndeterminateCheckbox.displayName = 'IndeterminateCheckbox';
|
|
@@ -5,6 +5,7 @@ type Props = {
|
|
|
5
5
|
handleRowClick?: (row: any) => void;
|
|
6
6
|
withSelect: boolean;
|
|
7
7
|
selectedFlatRows: RowType[];
|
|
8
|
+
uniqueKey: string;
|
|
8
9
|
};
|
|
9
|
-
export declare function Row({ row, selectedFlatRows, withSelect, handleRowClick }: Props): ReactElement;
|
|
10
|
+
export declare function Row({ row, selectedFlatRows, withSelect, uniqueKey, handleRowClick }: Props): ReactElement;
|
|
10
11
|
export {};
|
package/components/Table/Row.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
3
|
import React, { useMemo } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import { CHECKBOX_HEADER_ID, CHECKBOX_DEFAULT_WIDTH } from './utils.js';
|
|
5
6
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
6
7
|
import './IndeterminateCheckbox.js';
|
|
7
|
-
import '../../Alert
|
|
8
|
+
import '../../Alert--0rz5XL1.js';
|
|
8
9
|
import '../Alert/consts.js';
|
|
9
10
|
import '../Text/Text.js';
|
|
10
11
|
import '../../utils/helpers.js';
|
|
11
12
|
import 'dayjs';
|
|
12
13
|
import '@babel/runtime/helpers/defineProperty';
|
|
13
|
-
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
14
14
|
import '../../helperComponents/Loader/Loader.js';
|
|
15
15
|
import '@babel/runtime/helpers/slicedToArray';
|
|
16
16
|
import '../../consts/index.js';
|
|
@@ -21,12 +21,13 @@ import 'react-dropzone';
|
|
|
21
21
|
import '../SVGIcons/IconUpload.js';
|
|
22
22
|
import '../FileUpload/types.js';
|
|
23
23
|
import '../../helpers/format-date.js';
|
|
24
|
+
import 'dayjs/plugin/utc';
|
|
24
25
|
import '../../helpers/locale.js';
|
|
25
26
|
import '../../type/locale.js';
|
|
26
27
|
import '../../helpers/storage.js';
|
|
27
28
|
import 'react-toastify';
|
|
28
29
|
import '../../hooks/useGetIsMobile.js';
|
|
29
|
-
import '
|
|
30
|
+
import 'motion/react';
|
|
30
31
|
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
31
32
|
import '../../hooks/useOnOutsideClick.js';
|
|
32
33
|
import '../../hooks/useHideBodyScroll.js';
|
|
@@ -39,11 +40,12 @@ import '../../hooks/useGetElemPositions.js';
|
|
|
39
40
|
import '../../hooks/useGetTooltipPosition.js';
|
|
40
41
|
import '../../hooks/useHideOnScroll.js';
|
|
41
42
|
import 'react-syntax-highlighter';
|
|
43
|
+
import 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
42
44
|
import '../Link/Link.js';
|
|
43
45
|
import '../Popover/PopoverDesktop.js';
|
|
44
46
|
import '../SVGIcons/IconInfo.js';
|
|
45
|
-
import '
|
|
46
|
-
import '
|
|
47
|
+
import '../IconDynamicComponent/IconDynamicComponent.js';
|
|
48
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
47
49
|
import '@babel/runtime/helpers/typeof';
|
|
48
50
|
import '../SVGIcons/IconDismissFilled.js';
|
|
49
51
|
import '../SVGIcons/IconDelete.js';
|
|
@@ -53,17 +55,23 @@ import '../SVGIcons/IconArrowDownloadFilled.js';
|
|
|
53
55
|
import '../../helpers/download-file.js';
|
|
54
56
|
import '../Button/consts.js';
|
|
55
57
|
|
|
58
|
+
var _excluded = ["key"],
|
|
59
|
+
_excluded2 = ["key"];
|
|
56
60
|
function Row(_ref) {
|
|
57
61
|
var row = _ref.row,
|
|
58
62
|
selectedFlatRows = _ref.selectedFlatRows,
|
|
59
63
|
withSelect = _ref.withSelect,
|
|
64
|
+
uniqueKey = _ref.uniqueKey,
|
|
60
65
|
handleRowClick = _ref.handleRowClick;
|
|
61
66
|
var isRowSelected = useMemo(function () {
|
|
62
67
|
return selectedFlatRows.find(function (r) {
|
|
63
68
|
return r.id === row.id;
|
|
64
69
|
});
|
|
65
70
|
}, [selectedFlatRows]);
|
|
66
|
-
|
|
71
|
+
var _row$getRowProps = row.getRowProps();
|
|
72
|
+
_row$getRowProps.key;
|
|
73
|
+
var rowProps = _objectWithoutProperties(_row$getRowProps, _excluded);
|
|
74
|
+
return /*#__PURE__*/React.createElement("tr", _extends({}, rowProps, {
|
|
67
75
|
className: classNames({
|
|
68
76
|
selected: Boolean(isRowSelected)
|
|
69
77
|
}),
|
|
@@ -76,9 +84,12 @@ function Row(_ref) {
|
|
|
76
84
|
column = _ref2.column,
|
|
77
85
|
render = _ref2.render;
|
|
78
86
|
var isSelection = column.id === CHECKBOX_HEADER_ID;
|
|
87
|
+
var _getCellProps = getCellProps();
|
|
88
|
+
_getCellProps.key;
|
|
89
|
+
var cellProps = _objectWithoutProperties(_getCellProps, _excluded2);
|
|
79
90
|
return /*#__PURE__*/React.createElement("td", _extends({
|
|
80
|
-
key: i
|
|
81
|
-
},
|
|
91
|
+
key: "table_cell_".concat(uniqueKey, "_").concat(i)
|
|
92
|
+
}, cellProps, {
|
|
82
93
|
style: {
|
|
83
94
|
left: !isSelection && withSelect && (column === null || column === void 0 ? void 0 : column.fixed) === 'left' ? CHECKBOX_DEFAULT_WIDTH : 0
|
|
84
95
|
},
|
|
@@ -86,7 +97,11 @@ function Row(_ref) {
|
|
|
86
97
|
fixed_column_left: (column === null || column === void 0 ? void 0 : column.fixed) === 'left',
|
|
87
98
|
fixed_column_right: (column === null || column === void 0 ? void 0 : column.fixed) === 'right',
|
|
88
99
|
fixed_checkbox: isSelection && ((_arr$column = arr[i + 1].column) === null || _arr$column === void 0 ? void 0 : _arr$column.fixed) === 'left'
|
|
89
|
-
})
|
|
100
|
+
}),
|
|
101
|
+
onClick: function onClick(event) {
|
|
102
|
+
if (isSelection) event.stopPropagation();
|
|
103
|
+
cellProps.onClick && cellProps.onClick(event);
|
|
104
|
+
}
|
|
90
105
|
}), render('Cell'));
|
|
91
106
|
}));
|
|
92
107
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TTableProps } from './types';
|
|
3
|
-
export declare function Table({ columns, data, onChange, fixedHeader, withSelect, handleRowClick, className, containerRefHandler }: TTableProps): ReactElement;
|
|
3
|
+
export declare function Table({ columns, data, onChange, fixedHeader, withSelect, handleRowClick, className, language, containerRefHandler, submitButtons }: TTableProps): ReactElement;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/extends';
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import React, { useRef, useState, useMemo, useEffect } from 'react';
|
|
4
|
+
import React, { useRef, useState, useId, useMemo, useCallback, useEffect } from 'react';
|
|
5
5
|
import { useTable, useSortBy, useRowSelect } from 'react-table';
|
|
6
6
|
import { setSelectedRows } from './utils.js';
|
|
7
7
|
import { Row } from './Row.js';
|
|
8
8
|
import { Header } from './Header.js';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { useDispatchEventOnScroll } from '../../hooks/useDispatchEventOnScroll.js';
|
|
11
|
+
import { B as Button } from '../../Alert--0rz5XL1.js';
|
|
12
|
+
import { TABLE_LOCALIZATION } from './localization.js';
|
|
13
|
+
import { setTranslationValue } from '../../utils/helpers.js';
|
|
14
|
+
import { IconCheckmark } from '../SVGIcons/IconCheckmark.js';
|
|
15
|
+
import { IconDismiss } from '../SVGIcons/IconDismiss.js';
|
|
11
16
|
import './IndeterminateCheckbox.js';
|
|
12
|
-
import '../../Alert-w8FkRd9I.js';
|
|
13
17
|
import '../Alert/consts.js';
|
|
14
18
|
import '../Text/Text.js';
|
|
15
|
-
import '../../utils/helpers.js';
|
|
16
19
|
import 'dayjs';
|
|
17
20
|
import '@babel/runtime/helpers/defineProperty';
|
|
18
21
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -25,16 +28,16 @@ import 'react-dropzone';
|
|
|
25
28
|
import '../SVGIcons/IconUpload.js';
|
|
26
29
|
import '../FileUpload/types.js';
|
|
27
30
|
import '../../helpers/format-date.js';
|
|
31
|
+
import 'dayjs/plugin/utc';
|
|
28
32
|
import '../../helpers/locale.js';
|
|
29
33
|
import '../../type/locale.js';
|
|
30
34
|
import '../../helpers/storage.js';
|
|
31
35
|
import 'react-toastify';
|
|
32
36
|
import '../../hooks/useGetIsMobile.js';
|
|
33
|
-
import '
|
|
37
|
+
import 'motion/react';
|
|
34
38
|
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
35
39
|
import '../../hooks/useOnOutsideClick.js';
|
|
36
40
|
import '../../hooks/useHideBodyScroll.js';
|
|
37
|
-
import '../SVGIcons/IconDismiss.js';
|
|
38
41
|
import '../Tooltip/types.js';
|
|
39
42
|
import '../Tooltip/Tooltip.js';
|
|
40
43
|
import '../../hooks/useGetTooltipStyles.js';
|
|
@@ -43,11 +46,12 @@ import '../../hooks/useGetElemPositions.js';
|
|
|
43
46
|
import '../../hooks/useGetTooltipPosition.js';
|
|
44
47
|
import '../../hooks/useHideOnScroll.js';
|
|
45
48
|
import 'react-syntax-highlighter';
|
|
49
|
+
import 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
46
50
|
import '../Link/Link.js';
|
|
47
51
|
import '../Popover/PopoverDesktop.js';
|
|
48
52
|
import '../SVGIcons/IconInfo.js';
|
|
49
|
-
import '
|
|
50
|
-
import '
|
|
53
|
+
import '../IconDynamicComponent/IconDynamicComponent.js';
|
|
54
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
51
55
|
import '@babel/runtime/helpers/typeof';
|
|
52
56
|
import '../SVGIcons/IconDismissFilled.js';
|
|
53
57
|
import '../SVGIcons/IconDelete.js';
|
|
@@ -68,12 +72,16 @@ function Table(_ref) {
|
|
|
68
72
|
withSelect = _ref$withSelect === void 0 ? false : _ref$withSelect,
|
|
69
73
|
handleRowClick = _ref.handleRowClick,
|
|
70
74
|
className = _ref.className,
|
|
71
|
-
|
|
75
|
+
_ref$language = _ref.language,
|
|
76
|
+
language = _ref$language === void 0 ? 'en' : _ref$language,
|
|
77
|
+
containerRefHandler = _ref.containerRefHandler,
|
|
78
|
+
submitButtons = _ref.submitButtons;
|
|
72
79
|
var tableRef = useRef(null);
|
|
73
80
|
var _useState = useState(400),
|
|
74
81
|
_useState2 = _slicedToArray(_useState, 2),
|
|
75
82
|
tableWidth = _useState2[0],
|
|
76
83
|
setTableWidth = _useState2[1];
|
|
84
|
+
var uniqueKey = useId();
|
|
77
85
|
var dispatchScrollEvent = useDispatchEventOnScroll();
|
|
78
86
|
var sortedColumns = useMemo(function () {
|
|
79
87
|
var condition1 = function condition1(item) {
|
|
@@ -111,16 +119,17 @@ function Table(_ref) {
|
|
|
111
119
|
headerGroups = _ref2.headerGroups,
|
|
112
120
|
rows = _ref2.rows,
|
|
113
121
|
prepareRow = _ref2.prepareRow,
|
|
122
|
+
toggleAllRowsSelected = _ref2.toggleAllRowsSelected,
|
|
114
123
|
state = _ref2.state;
|
|
115
|
-
|
|
116
|
-
onChange === null || onChange === void 0 || onChange(state);
|
|
117
|
-
}, [JSON.stringify(state)]);
|
|
118
|
-
var handleResize = function handleResize() {
|
|
124
|
+
var handleResize = useCallback(function () {
|
|
119
125
|
if (tableRef.current) {
|
|
120
126
|
var _tableRef$current;
|
|
121
127
|
setTableWidth((_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.offsetWidth);
|
|
122
128
|
}
|
|
123
|
-
};
|
|
129
|
+
}, [tableRef.current]);
|
|
130
|
+
useEffect(function () {
|
|
131
|
+
onChange === null || onChange === void 0 || onChange(state);
|
|
132
|
+
}, [JSON.stringify(state)]);
|
|
124
133
|
useEffect(function () {
|
|
125
134
|
window.addEventListener('resize', handleResize);
|
|
126
135
|
if (tableRef.current) {
|
|
@@ -131,6 +140,9 @@ function Table(_ref) {
|
|
|
131
140
|
window.removeEventListener('resize', handleResize);
|
|
132
141
|
};
|
|
133
142
|
}, [tableRef.current]);
|
|
143
|
+
var onClearSelectedRows = useCallback(function () {
|
|
144
|
+
toggleAllRowsSelected(false);
|
|
145
|
+
}, []);
|
|
134
146
|
return /*#__PURE__*/React.createElement("div", {
|
|
135
147
|
onScroll: dispatchScrollEvent,
|
|
136
148
|
ref: containerRefHandler,
|
|
@@ -138,15 +150,45 @@ function Table(_ref) {
|
|
|
138
150
|
style: {
|
|
139
151
|
maxHeight: fixedHeader === null || fixedHeader === void 0 ? void 0 : fixedHeader.y
|
|
140
152
|
}
|
|
141
|
-
}, /*#__PURE__*/React.createElement("
|
|
153
|
+
}, withSelect && selectedFlatRows.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: "table-wrapper__selected-rows"
|
|
155
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
156
|
+
buttonText: setTranslationValue(TABLE_LOCALIZATION[language].n_selected || '', selectedFlatRows.length),
|
|
157
|
+
onClick: onClearSelectedRows,
|
|
158
|
+
type: "tertiary",
|
|
159
|
+
size: "medium",
|
|
160
|
+
iconProps: {
|
|
161
|
+
alignment: 'left',
|
|
162
|
+
Component: IconDismiss
|
|
163
|
+
}
|
|
164
|
+
}), submitButtons === null || submitButtons === void 0 ? void 0 : submitButtons.map(function (_ref3) {
|
|
165
|
+
var buttonText = _ref3.buttonText,
|
|
166
|
+
isLoading = _ref3.isLoading,
|
|
167
|
+
_onClick = _ref3.onClick;
|
|
168
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
169
|
+
iconProps: {
|
|
170
|
+
alignment: 'left',
|
|
171
|
+
Component: IconCheckmark
|
|
172
|
+
},
|
|
173
|
+
onClick: function onClick(event) {
|
|
174
|
+
_onClick(event, state, onClearSelectedRows);
|
|
175
|
+
},
|
|
176
|
+
buttonText: buttonText || 'Submit',
|
|
177
|
+
type: "secondary",
|
|
178
|
+
size: "medium",
|
|
179
|
+
className: "mr-8",
|
|
180
|
+
isLoading: isLoading
|
|
181
|
+
});
|
|
182
|
+
})), /*#__PURE__*/React.createElement("table", _extends({}, getTableProps(), {
|
|
142
183
|
ref: tableRef
|
|
143
184
|
}), /*#__PURE__*/React.createElement("thead", null, headerGroups.map(function (headerGroup, i) {
|
|
144
185
|
return /*#__PURE__*/React.createElement(Header, {
|
|
145
|
-
key: i,
|
|
186
|
+
key: "table_head_".concat(uniqueKey, "_").concat(i),
|
|
146
187
|
withSelect: withSelect,
|
|
147
188
|
fixedHeader: Boolean(fixedHeader),
|
|
148
189
|
headerGroup: headerGroup,
|
|
149
|
-
tableWidth: tableWidth
|
|
190
|
+
tableWidth: tableWidth,
|
|
191
|
+
uniqueKey: uniqueKey
|
|
150
192
|
});
|
|
151
193
|
})), /*#__PURE__*/React.createElement("tbody", getTableBodyProps(), rows.map(function (row) {
|
|
152
194
|
prepareRow(row);
|
|
@@ -155,7 +197,8 @@ function Table(_ref) {
|
|
|
155
197
|
withSelect: withSelect,
|
|
156
198
|
selectedFlatRows: selectedFlatRows,
|
|
157
199
|
row: row,
|
|
158
|
-
key: row.id
|
|
200
|
+
key: "table_row_".concat(uniqueKey, "_").concat(row.id),
|
|
201
|
+
uniqueKey: uniqueKey
|
|
159
202
|
});
|
|
160
203
|
}))));
|
|
161
204
|
}
|
|
@@ -6,7 +6,7 @@ import 'react';
|
|
|
6
6
|
import 'react-table';
|
|
7
7
|
import './utils.js';
|
|
8
8
|
import './IndeterminateCheckbox.js';
|
|
9
|
-
import '../../Alert
|
|
9
|
+
import '../../Alert--0rz5XL1.js';
|
|
10
10
|
import '../Alert/consts.js';
|
|
11
11
|
import 'classnames';
|
|
12
12
|
import '../Text/Text.js';
|
|
@@ -23,12 +23,13 @@ import 'react-dropzone';
|
|
|
23
23
|
import '../SVGIcons/IconUpload.js';
|
|
24
24
|
import '../FileUpload/types.js';
|
|
25
25
|
import '../../helpers/format-date.js';
|
|
26
|
+
import 'dayjs/plugin/utc';
|
|
26
27
|
import '../../helpers/locale.js';
|
|
27
28
|
import '../../type/locale.js';
|
|
28
29
|
import '../../helpers/storage.js';
|
|
29
30
|
import 'react-toastify';
|
|
30
31
|
import '../../hooks/useGetIsMobile.js';
|
|
31
|
-
import '
|
|
32
|
+
import 'motion/react';
|
|
32
33
|
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
33
34
|
import '../../hooks/useOnOutsideClick.js';
|
|
34
35
|
import '../../hooks/useHideBodyScroll.js';
|
|
@@ -41,11 +42,12 @@ import '../../hooks/useGetElemPositions.js';
|
|
|
41
42
|
import '../../hooks/useGetTooltipPosition.js';
|
|
42
43
|
import '../../hooks/useHideOnScroll.js';
|
|
43
44
|
import 'react-syntax-highlighter';
|
|
45
|
+
import 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
44
46
|
import '../Link/Link.js';
|
|
45
47
|
import '../Popover/PopoverDesktop.js';
|
|
46
48
|
import '../SVGIcons/IconInfo.js';
|
|
47
|
-
import '
|
|
48
|
-
import '
|
|
49
|
+
import '../IconDynamicComponent/IconDynamicComponent.js';
|
|
50
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
49
51
|
import '@babel/runtime/helpers/typeof';
|
|
50
52
|
import '../SVGIcons/IconDismissFilled.js';
|
|
51
53
|
import '../SVGIcons/IconDelete.js';
|
|
@@ -59,3 +61,5 @@ import './Header.js';
|
|
|
59
61
|
import '../SVGIcons/IconArrowDown.js';
|
|
60
62
|
import '../SVGIcons/IconArrowUp.js';
|
|
61
63
|
import '../../hooks/useDispatchEventOnScroll.js';
|
|
64
|
+
import './localization.js';
|
|
65
|
+
import '../SVGIcons/IconCheckmark.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Column, TableState } from 'react-table';
|
|
2
|
+
import { TButtonPropTypes } from '../Button/types';
|
|
2
3
|
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
|
|
3
4
|
export type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
4
5
|
export type TColumnProps = {
|
|
@@ -11,6 +12,9 @@ export type TColumnFields = {
|
|
|
11
12
|
widthInPercent?: IntRange<0, 100>;
|
|
12
13
|
};
|
|
13
14
|
export type TColumn = Column & TColumnFields;
|
|
15
|
+
export interface IButtonPropTypes extends Omit<TButtonPropTypes, 'onClick'> {
|
|
16
|
+
onClick: (event: TClickEventType, data: any, clearRowSelection?: () => void) => void;
|
|
17
|
+
}
|
|
14
18
|
export type TTableProps = {
|
|
15
19
|
className?: string;
|
|
16
20
|
columns: TColumn[];
|
|
@@ -22,6 +26,8 @@ export type TTableProps = {
|
|
|
22
26
|
handleRowClick?: (row: any) => void;
|
|
23
27
|
onChange?: (state: TableState) => void;
|
|
24
28
|
containerRefHandler?: (ref: HTMLDivElement) => void;
|
|
29
|
+
language?: string;
|
|
30
|
+
submitButtons?: IButtonPropTypes[];
|
|
25
31
|
};
|
|
26
32
|
export type SortBy = {
|
|
27
33
|
id: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
1
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { IndeterminateCheckbox } from './IndeterminateCheckbox.js';
|
|
4
|
-
import '../../Alert
|
|
5
|
-
import '@babel/runtime/helpers/extends';
|
|
5
|
+
import '../../Alert--0rz5XL1.js';
|
|
6
6
|
import '../Alert/consts.js';
|
|
7
7
|
import 'classnames';
|
|
8
8
|
import '../Text/Text.js';
|
|
@@ -20,12 +20,13 @@ import 'react-dropzone';
|
|
|
20
20
|
import '../SVGIcons/IconUpload.js';
|
|
21
21
|
import '../FileUpload/types.js';
|
|
22
22
|
import '../../helpers/format-date.js';
|
|
23
|
+
import 'dayjs/plugin/utc';
|
|
23
24
|
import '../../helpers/locale.js';
|
|
24
25
|
import '../../type/locale.js';
|
|
25
26
|
import '../../helpers/storage.js';
|
|
26
27
|
import 'react-toastify';
|
|
27
28
|
import '../../hooks/useGetIsMobile.js';
|
|
28
|
-
import '
|
|
29
|
+
import 'motion/react';
|
|
29
30
|
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
30
31
|
import '../../hooks/useOnOutsideClick.js';
|
|
31
32
|
import '../../hooks/useHideBodyScroll.js';
|
|
@@ -38,11 +39,12 @@ import '../../hooks/useGetElemPositions.js';
|
|
|
38
39
|
import '../../hooks/useGetTooltipPosition.js';
|
|
39
40
|
import '../../hooks/useHideOnScroll.js';
|
|
40
41
|
import 'react-syntax-highlighter';
|
|
42
|
+
import 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
41
43
|
import '../Link/Link.js';
|
|
42
44
|
import '../Popover/PopoverDesktop.js';
|
|
43
45
|
import '../SVGIcons/IconInfo.js';
|
|
44
|
-
import '
|
|
45
|
-
import '
|
|
46
|
+
import '../IconDynamicComponent/IconDynamicComponent.js';
|
|
47
|
+
import 'react-toastify/dist/ReactToastify.css';
|
|
46
48
|
import '@babel/runtime/helpers/typeof';
|
|
47
49
|
import '../SVGIcons/IconDismissFilled.js';
|
|
48
50
|
import '../SVGIcons/IconDelete.js';
|
|
@@ -60,12 +62,38 @@ function setSelectedRows(hooks, withSelect) {
|
|
|
60
62
|
return [{
|
|
61
63
|
id: CHECKBOX_HEADER_ID,
|
|
62
64
|
Header: function Header(_ref) {
|
|
63
|
-
var getToggleAllRowsSelectedProps = _ref.getToggleAllRowsSelectedProps
|
|
64
|
-
|
|
65
|
+
var getToggleAllRowsSelectedProps = _ref.getToggleAllRowsSelectedProps,
|
|
66
|
+
rows = _ref.rows,
|
|
67
|
+
state = _ref.state,
|
|
68
|
+
toggleRowSelected = _ref.toggleRowSelected;
|
|
69
|
+
var allEnabledRows = rows.filter(function (row) {
|
|
70
|
+
return 'enableSelection' in row.original ? row.original.enableSelection : true;
|
|
71
|
+
});
|
|
72
|
+
var allSelected = allEnabledRows.every(function (row) {
|
|
73
|
+
return state.selectedRowIds[row.id];
|
|
74
|
+
});
|
|
75
|
+
var someSelected = allEnabledRows.some(function (row) {
|
|
76
|
+
return state.selectedRowIds[row.id];
|
|
77
|
+
});
|
|
78
|
+
return /*#__PURE__*/React.createElement(IndeterminateCheckbox, _extends({}, getToggleAllRowsSelectedProps({
|
|
79
|
+
checked: allSelected,
|
|
80
|
+
indeterminate: !allSelected && someSelected,
|
|
81
|
+
disabled: allEnabledRows.length === 0
|
|
82
|
+
}), {
|
|
83
|
+
onChange: function onChange(e) {
|
|
84
|
+
var checked = e.target.checked;
|
|
85
|
+
allEnabledRows.forEach(function (row) {
|
|
86
|
+
toggleRowSelected(row.id, checked);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
65
90
|
},
|
|
66
91
|
Cell: function Cell(_ref2) {
|
|
67
92
|
var row = _ref2.row;
|
|
68
|
-
|
|
93
|
+
var disabled = 'enableSelection' in row.original ? !row.original.enableSelection : false;
|
|
94
|
+
return /*#__PURE__*/React.createElement(IndeterminateCheckbox, row.getToggleRowSelectedProps({
|
|
95
|
+
disabled: disabled
|
|
96
|
+
}));
|
|
69
97
|
}
|
|
70
98
|
}].concat(_toConsumableArray(columns));
|
|
71
99
|
});
|