oa-componentbook 1.0.1-stage.39 → 1.0.1-stage.390
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/build/components/oa-component-accordion/Accordion.js +129 -40
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +24 -19
- package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
- package/build/components/oa-component-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
- package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
- package/build/components/oa-component-icons/MaterialIcon.js +1 -1
- package/build/components/oa-component-info/CustomInfo.js +9 -4
- package/build/components/oa-component-info/styles.js +3 -3
- package/build/components/oa-component-modal/styles.js +3 -2
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-select/CustomSelect.js +116 -56
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +28 -5
- package/build/components/oa-component-table/CustomTableV1.js +610 -0
- package/build/components/oa-component-table/styles.js +1 -1
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +1 -1
- package/build/components/oa-component-tag/CustomTag.js +29 -11
- package/build/components/oa-component-tag/styles.js +30 -3
- package/build/components/oa-component-textarea/{TextArea.js → CustomTextArea.js} +4 -4
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +120 -40
- package/build/components/oa-component-viewer/CustomViewer.js +3 -1
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +3 -0
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/images/Car.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/index.js +110 -5
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +235 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +63 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2293 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +84 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +85 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +87 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +294 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +25 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +544 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
- package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +395 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
- package/build/widgets/oa-widget-detailcard/styles.js +1 -1
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +149 -64
- package/build/widgets/oa-widget-image-carousel/styles.js +16 -5
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +77 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
- package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +105 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/sidebar.css +0 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +57 -29
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +28 -6
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +103 -0
- package/build/widgets/oa-widget-track-shipment-list/fn.js +81 -0
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +352 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +3 -1
- package/build/dev/oa-widget-track-shipment/TrackShipmentWidget.js +0 -195
- /package/build/{dev/oa-widget-track-shipment → widgets/oa-widget-track-shipment-list}/styles.js +0 -0
|
@@ -27,6 +27,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
* @param {string} fontColor - The color of the text.
|
|
28
28
|
* @param {object} iconConfig - Configuration for the icon.
|
|
29
29
|
* @param {string} title - The title to be displayed.
|
|
30
|
+
* @param {string} borderColor - The border color of the component.
|
|
30
31
|
*
|
|
31
32
|
* @returns {ReactElement} A styled component with the specified properties.
|
|
32
33
|
*/
|
|
@@ -37,7 +38,8 @@ function CustomInfo(_ref) {
|
|
|
37
38
|
description,
|
|
38
39
|
fontColor,
|
|
39
40
|
iconConfig,
|
|
40
|
-
title
|
|
41
|
+
title,
|
|
42
|
+
borderColor
|
|
41
43
|
} = _ref;
|
|
42
44
|
/**
|
|
43
45
|
* Renders the icon based on the presence of a title.
|
|
@@ -65,7 +67,8 @@ function CustomInfo(_ref) {
|
|
|
65
67
|
}, renderIcon()) : renderIcon();
|
|
66
68
|
};
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_styles.InfoContainer, {
|
|
68
|
-
$color: color
|
|
70
|
+
$color: color,
|
|
71
|
+
$borderColor: borderColor
|
|
69
72
|
}, /*#__PURE__*/_react.default.createElement(_styles.RowFlex, null, iconConfig.position === 'left' && conditionallyAddTooltipToIcon(), /*#__PURE__*/_react.default.createElement(_styles.ColFlex, null, title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
70
73
|
color: fontColor,
|
|
71
74
|
typography: "type-t2-700"
|
|
@@ -96,7 +99,8 @@ CustomInfo.propTypes = {
|
|
|
96
99
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
97
100
|
tooltipText: _propTypes.default.string
|
|
98
101
|
}),
|
|
99
|
-
title: _propTypes.default.string
|
|
102
|
+
title: _propTypes.default.string,
|
|
103
|
+
borderColor: _propTypes.default.string
|
|
100
104
|
};
|
|
101
105
|
CustomInfo.defaultProps = {
|
|
102
106
|
buttonConfig: {
|
|
@@ -110,5 +114,6 @@ CustomInfo.defaultProps = {
|
|
|
110
114
|
},
|
|
111
115
|
fontColor: 'primary-content',
|
|
112
116
|
title: '',
|
|
113
|
-
description: ''
|
|
117
|
+
description: '',
|
|
118
|
+
borderColor: ''
|
|
114
119
|
};
|
|
@@ -8,8 +8,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const RowFlex = exports.RowFlex = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
12
|
-
const ColFlex = exports.ColFlex = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
11
|
+
const RowFlex = exports.RowFlex = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n"])));
|
|
12
|
+
const ColFlex = exports.ColFlex = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));
|
|
13
13
|
const InfoContainer = exports.InfoContainer = (0, _styledComponents.default)(RowFlex).attrs({
|
|
14
14
|
as: 'section'
|
|
15
|
-
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n \n button {\n margin-left: 8px;\n }
|
|
15
|
+
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n border: 1px solid var(--color-", ");\n\n button {\n margin-left: 8px;\n }\n"])), props => props.$color, props => props.$borderColor);
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TitleContainer = exports.DescriptionContainer = exports.ButtonContainer = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
9
|
+
/* eslint-disable */
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const ButtonContainer = exports.ButtonContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: flex-end;\n margin:
|
|
12
|
+
const ButtonContainer = exports.ButtonContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: flex-end;\n margin: 36px 0 0;\n @media (max-width: 768px) {\n justify-content: space-between;\n button{\n width: 100%;\n }\n }\n"])));
|
|
12
13
|
const DescriptionContainer = exports.DescriptionContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 12px 0 0;\n"])));
|
|
13
|
-
const TitleContainer = exports.TitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
14
|
+
const TitleContainer = exports.TitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 32px 0 0 0;\n display: flex;\n flex-direction: column;\n gap: 16px;\n img {\n height: 36px;\n width: 36px;\n }\n"])));
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
12
|
+
var _TypographiesMap = _interopRequireDefault(require("../../global-css/TypographiesMap"));
|
|
13
|
+
var _styles = require("./styles");
|
|
14
|
+
const _excluded = ["current", "total", "pageSize", "onChange", "onShowSizeChange", "pageSizeOptions", "showSizeChanger", "showQuickJumper", "showTotal", "size", "style"];
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
/**
|
|
20
|
+
* @description A custom wrapper for Ant Design Pagination component with consistent theming.
|
|
21
|
+
* @param {number} current - The current page number (1-based).
|
|
22
|
+
* @param {number} total - The total number of items.
|
|
23
|
+
* @param {number} pageSize - The number of items per page.
|
|
24
|
+
* @param {function} onChange - Callback function when page changes.
|
|
25
|
+
* @param {function} onShowSizeChange - Callback function when page size changes.
|
|
26
|
+
* @param {array} pageSizeOptions - Array of page size options.
|
|
27
|
+
* @param {boolean} showSizeChanger - Whether to show the page size selector.
|
|
28
|
+
* @param {boolean} showQuickJumper - Whether to show the quick jumper input.
|
|
29
|
+
* @param {boolean} showTotal - Whether to show the total items count.
|
|
30
|
+
* @param {string} size - The size of the pagination component.
|
|
31
|
+
* @param {object} style - Custom styles for the component.
|
|
32
|
+
* @param {object} antDesignProps - Additional props to pass to Ant Design Pagination.
|
|
33
|
+
* @returns {JSX.Element} The rendered pagination component.
|
|
34
|
+
*/
|
|
35
|
+
function CustomPagination(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
current = 1,
|
|
38
|
+
total = 0,
|
|
39
|
+
pageSize = 10,
|
|
40
|
+
onChange,
|
|
41
|
+
onShowSizeChange,
|
|
42
|
+
pageSizeOptions = [10, 20, 50, 100],
|
|
43
|
+
showSizeChanger = true,
|
|
44
|
+
showQuickJumper = false,
|
|
45
|
+
showTotal = true,
|
|
46
|
+
size = 'default',
|
|
47
|
+
style
|
|
48
|
+
} = _ref,
|
|
49
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const renderTotal = (totalItems, range) => {
|
|
51
|
+
if (!showTotal) return null;
|
|
52
|
+
return "Showing ".concat(range[0], "-").concat(range[1], " of ").concat(totalItems, " items");
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_styles.MainContainer, {
|
|
55
|
+
style: style
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
57
|
+
theme: {
|
|
58
|
+
components: {
|
|
59
|
+
Pagination: {}
|
|
60
|
+
},
|
|
61
|
+
token: {
|
|
62
|
+
colorPrimary: '#014FC5',
|
|
63
|
+
colorPrimaryBorder: '#014FC5',
|
|
64
|
+
colorPrimaryHover: '#82A9E2',
|
|
65
|
+
colorText: '#212121',
|
|
66
|
+
colorTextDisabled: '#BFBFBF',
|
|
67
|
+
colorTextPlaceholder: '#959595',
|
|
68
|
+
borderRadius: 2,
|
|
69
|
+
colorBorder: '#E0E0E0'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Pagination, _extends({
|
|
73
|
+
current: current,
|
|
74
|
+
total: total,
|
|
75
|
+
pageSize: pageSize,
|
|
76
|
+
onChange: onChange,
|
|
77
|
+
onShowSizeChange: onShowSizeChange,
|
|
78
|
+
showSizeChanger: showSizeChanger,
|
|
79
|
+
showQuickJumper: showQuickJumper,
|
|
80
|
+
showTotal: renderTotal,
|
|
81
|
+
pageSizeOptions: pageSizeOptions,
|
|
82
|
+
size: size
|
|
83
|
+
}, antDesignProps))));
|
|
84
|
+
}
|
|
85
|
+
CustomPagination.propTypes = {
|
|
86
|
+
current: _propTypes.default.number,
|
|
87
|
+
total: _propTypes.default.number,
|
|
88
|
+
pageSize: _propTypes.default.number,
|
|
89
|
+
onChange: _propTypes.default.func,
|
|
90
|
+
onShowSizeChange: _propTypes.default.func,
|
|
91
|
+
pageSizeOptions: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
92
|
+
showSizeChanger: _propTypes.default.bool,
|
|
93
|
+
showQuickJumper: _propTypes.default.bool,
|
|
94
|
+
showTotal: _propTypes.default.bool,
|
|
95
|
+
size: _propTypes.default.oneOf(['default', 'small']),
|
|
96
|
+
style: _propTypes.default.object
|
|
97
|
+
};
|
|
98
|
+
CustomPagination.defaultProps = {
|
|
99
|
+
current: 1,
|
|
100
|
+
total: 0,
|
|
101
|
+
pageSize: 10,
|
|
102
|
+
onChange: undefined,
|
|
103
|
+
onShowSizeChange: undefined,
|
|
104
|
+
pageSizeOptions: [10, 20, 50, 100],
|
|
105
|
+
showSizeChanger: true,
|
|
106
|
+
showQuickJumper: false,
|
|
107
|
+
showTotal: true,
|
|
108
|
+
size: 'default',
|
|
109
|
+
style: undefined
|
|
110
|
+
};
|
|
111
|
+
var _default = exports.default = CustomPagination;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.MainContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-pagination-item {\n border: 1px solid #E0E0E0;\n }\n .ant-pagination-item-active {\n border: 1px solid #014FC5;\n }\n .mobile-pagination{margin: 0;padding:0;}\n .ant-pagination-total-text,.ant-pagination-options{display: none;}\n"])));
|
|
12
|
+
var _default = exports.default = {};
|
|
@@ -22,9 +22,10 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
|
|
|
22
22
|
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
23
23
|
require("antd/dist/reset.css");
|
|
24
24
|
var _Elevation = require("../../global-css/Elevation");
|
|
25
|
-
const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder"],
|
|
25
|
+
const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder", "maxSelectForMultiSelect", "onCustomSelect"],
|
|
26
26
|
_excluded2 = ["label", "disabled", "value"];
|
|
27
27
|
var _templateObject;
|
|
28
|
+
/* eslint-disable */
|
|
28
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
30
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -40,7 +41,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
40
41
|
const {
|
|
41
42
|
Option
|
|
42
43
|
} = _antd.Select;
|
|
43
|
-
const StyledSelect = (0, _styledComponents.default)(_antd.Select)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Hiding the last tag in case of All being selected. */\n
|
|
44
|
+
const StyledSelect = (0, _styledComponents.default)(_antd.Select)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Hiding the last tag in case of All being selected. */\n .ant-select-selection-overflow-item.ant-select-selection-overflow-item-rest {\n display: ", ";\n }\n .ant-select-selection-item-content {\n max-width: 70px;\n }\n"])), props => props.maxTagCount === 1 ? "none" : undefined);
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Takes an array of values and an object mapping values to labels and returns an
|
|
@@ -75,17 +76,18 @@ function CustomSelect(_ref) {
|
|
|
75
76
|
allText,
|
|
76
77
|
children,
|
|
77
78
|
defaultValue,
|
|
78
|
-
|
|
79
|
+
"data-test": dataTest,
|
|
79
80
|
mode,
|
|
80
81
|
onSelectionChange,
|
|
81
82
|
options,
|
|
82
|
-
placeholder
|
|
83
|
+
placeholder,
|
|
84
|
+
maxSelectForMultiSelect,
|
|
85
|
+
onCustomSelect
|
|
83
86
|
} = _ref,
|
|
84
87
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
85
88
|
// If allText is present in default values, we select all the options manually.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (mode === 'multiple' && allText && defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(allText)) {
|
|
89
|
+
const actualDefaultValue = mode === "multiple" ? [...defaultValue] : defaultValue;
|
|
90
|
+
if (mode === "multiple" && allText && defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(allText)) {
|
|
89
91
|
var _options$filter$map, _options$filter;
|
|
90
92
|
// Emptying the array first.
|
|
91
93
|
actualDefaultValue.length = 0;
|
|
@@ -99,52 +101,77 @@ function CustomSelect(_ref) {
|
|
|
99
101
|
return !((_option$disabled = option === null || option === void 0 ? void 0 : option.disabled) !== null && _option$disabled !== void 0 ? _option$disabled : false);
|
|
100
102
|
})) === null || _options$filter === void 0 ? void 0 : _options$filter.map(option => option.value)) !== null && _options$filter$map !== void 0 ? _options$filter$map : []));
|
|
101
103
|
}
|
|
102
|
-
const
|
|
104
|
+
const [selectedOptions, setSelectedOptions] = (0, _react.useState)(actualDefaultValue);
|
|
105
|
+
const valueLabelMap = Array.isArray(options) && (options === null || options === void 0 ? void 0 : options.reduce((accumulator, option) => {
|
|
103
106
|
var _option$label;
|
|
104
107
|
accumulator[option.value] = (_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : option.value;
|
|
105
108
|
return accumulator;
|
|
106
|
-
}, {});
|
|
107
|
-
const actualOptions = options
|
|
109
|
+
}, {}));
|
|
110
|
+
const actualOptions = Array.isArray(options) && options.map(option => {
|
|
108
111
|
const {
|
|
109
112
|
label,
|
|
110
113
|
disabled = false,
|
|
111
114
|
value
|
|
112
115
|
} = option,
|
|
113
116
|
otherProperties = _objectWithoutProperties(option, _excluded2);
|
|
117
|
+
const shouldDisableOption = (option, selectedOptions, maxSelectForMultiSelect, allText) => {
|
|
118
|
+
var _selectedOptions$filt;
|
|
119
|
+
// If option is already disabled, keep it disabled
|
|
120
|
+
if (option.disabled) return true;
|
|
121
|
+
|
|
122
|
+
// If no max limit, don't disable
|
|
123
|
+
if (!maxSelectForMultiSelect) return false;
|
|
124
|
+
|
|
125
|
+
// If this option is already selected, don't disable it (so user can deselect)
|
|
126
|
+
if (selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.includes(option.value)) return false;
|
|
127
|
+
|
|
128
|
+
// If this is the 'all' option, don't disable it
|
|
129
|
+
if (option.value === allText) return false;
|
|
130
|
+
|
|
131
|
+
// Check if we've reached the max limit (excluding allText)
|
|
132
|
+
const actualSelectionCount = (selectedOptions === null || selectedOptions === void 0 || (_selectedOptions$filt = selectedOptions.filter(val => val !== allText)) === null || _selectedOptions$filt === void 0 ? void 0 : _selectedOptions$filt.length) || 0;
|
|
133
|
+
return actualSelectionCount >= maxSelectForMultiSelect;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// Determine if this option should be disabled due to max limit
|
|
137
|
+
const shouldBeDisabled = shouldDisableOption(option, selectedOptions, maxSelectForMultiSelect, allText);
|
|
138
|
+
const finalDisabled = disabled || shouldBeDisabled;
|
|
114
139
|
if ((0, _utils.isString)(label) || (0, _utils.isNumber)(label)) {
|
|
115
140
|
return _objectSpread({
|
|
116
141
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
117
|
-
color:
|
|
142
|
+
color: finalDisabled ? "placeholder-text" : undefined,
|
|
118
143
|
typography: "type-b2-400",
|
|
144
|
+
title: label,
|
|
119
145
|
"data-test": dataTest ? "".concat(dataTest, "-(").concat(label, ")") : undefined
|
|
120
146
|
}, label),
|
|
121
|
-
disabled,
|
|
147
|
+
disabled: finalDisabled,
|
|
122
148
|
value
|
|
123
149
|
}, otherProperties);
|
|
124
150
|
}
|
|
125
151
|
if ( /*#__PURE__*/_react.default.isValidElement(label)) {
|
|
126
152
|
return _objectSpread({
|
|
127
153
|
label: dataTest ? /*#__PURE__*/_react.default.cloneElement(label, {
|
|
128
|
-
|
|
154
|
+
"data-test": "".concat(dataTest, "-(").concat(label, ")")
|
|
129
155
|
}) : label,
|
|
130
|
-
disabled,
|
|
156
|
+
disabled: finalDisabled,
|
|
131
157
|
value
|
|
132
158
|
}, otherProperties);
|
|
133
159
|
}
|
|
134
160
|
if ((0, _utils.isString)(value) || (0, _utils.isNumber)(value)) {
|
|
135
161
|
return _objectSpread({
|
|
136
162
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
137
|
-
color:
|
|
163
|
+
color: finalDisabled ? "placeholder-text" : undefined,
|
|
138
164
|
typography: "type-b2-400",
|
|
139
165
|
"data-test": dataTest ? "".concat(dataTest, "-(").concat(value, ")") : undefined
|
|
140
166
|
}, value),
|
|
141
167
|
value,
|
|
142
|
-
disabled
|
|
168
|
+
disabled: finalDisabled
|
|
143
169
|
}, otherProperties);
|
|
144
170
|
}
|
|
145
|
-
return option
|
|
171
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
172
|
+
disabled: finalDisabled
|
|
173
|
+
});
|
|
146
174
|
});
|
|
147
|
-
const [selectedOptions, setSelectedOptions] = (0, _react.useState)(actualDefaultValue);
|
|
148
175
|
|
|
149
176
|
/**
|
|
150
177
|
* Return a placeholder text for the maxTagCount option.
|
|
@@ -203,7 +230,18 @@ function CustomSelect(_ref) {
|
|
|
203
230
|
value
|
|
204
231
|
});
|
|
205
232
|
};
|
|
206
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Checks if maximum selection limit has been reached
|
|
235
|
+
* @param {Array} currentSelection - Current selected options array
|
|
236
|
+
* @param {Boolean} isSelecting - Whether we're selecting (true) or deselecting (false)
|
|
237
|
+
* @returns {Boolean} - True if max limit would be exceeded
|
|
238
|
+
*/
|
|
239
|
+
const isMaxSelectReached = currentSelection => {
|
|
240
|
+
var _currentSelection$fil;
|
|
241
|
+
// Count selections excluding allText if present
|
|
242
|
+
const actualSelectionCount = (currentSelection === null || currentSelection === void 0 || (_currentSelection$fil = currentSelection.filter(option => option !== allText)) === null || _currentSelection$fil === void 0 ? void 0 : _currentSelection$fil.length) || 0;
|
|
243
|
+
return actualSelectionCount >= maxSelectForMultiSelect;
|
|
244
|
+
};
|
|
207
245
|
/**
|
|
208
246
|
* This function is called whenever the selection changes for a multiple select.
|
|
209
247
|
* @param {Boolean} select - True if the option was selected, false if it was deselected.
|
|
@@ -222,6 +260,10 @@ function CustomSelect(_ref) {
|
|
|
222
260
|
newlySelectedOptions.splice(allIndex, 1);
|
|
223
261
|
}
|
|
224
262
|
if (select) {
|
|
263
|
+
if (maxSelectForMultiSelect && value !== allText && isMaxSelectReached(newlySelectedOptions)) {
|
|
264
|
+
// Don't proceed with selection if max limit reached
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
225
267
|
if (value === allText) {
|
|
226
268
|
newlySelectedOptions.length = 0; // Emptying the array.
|
|
227
269
|
|
|
@@ -229,7 +271,7 @@ function CustomSelect(_ref) {
|
|
|
229
271
|
addAllOptions(options, newlySelectedOptions);
|
|
230
272
|
} else {
|
|
231
273
|
safePush(newlySelectedOptions, value);
|
|
232
|
-
const enabledOptions = options.filter(option => {
|
|
274
|
+
const enabledOptions = options === null || options === void 0 ? void 0 : options.filter(option => {
|
|
233
275
|
var _option$disabled2;
|
|
234
276
|
return !((_option$disabled2 = option === null || option === void 0 ? void 0 : option.disabled) !== null && _option$disabled2 !== void 0 ? _option$disabled2 : false);
|
|
235
277
|
});
|
|
@@ -249,14 +291,14 @@ function CustomSelect(_ref) {
|
|
|
249
291
|
onSelectionChange(valuesArrayToOptionArray(optionsWithoutAllText, valueLabelMap));
|
|
250
292
|
setSelectedOptions(newlySelectedOptions);
|
|
251
293
|
};
|
|
252
|
-
const onOptionsChange = mode ===
|
|
294
|
+
const onOptionsChange = mode === "multiple" ? onOptionsChangeForMultiple : onOptionsChangeForSingle;
|
|
253
295
|
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
254
296
|
theme: {
|
|
255
297
|
components: {
|
|
256
298
|
Select: {
|
|
257
|
-
optionHeight: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
258
|
-
optionSelectedBg: _ColorVariablesMap.default[
|
|
259
|
-
optionSelectedColor: _ColorVariablesMap.default[
|
|
299
|
+
optionHeight: (props === null || props === void 0 ? void 0 : props.size) === "small" ? "36px" : "52px",
|
|
300
|
+
optionSelectedBg: _ColorVariablesMap.default["--color-primary-background"],
|
|
301
|
+
optionSelectedColor: _ColorVariablesMap.default["--color-primary"]
|
|
260
302
|
// optionPadding: [3, 2],
|
|
261
303
|
// optionPadding: (props?.size === 'small') ? '8px 12px' : '16 16',
|
|
262
304
|
// activeShadow: '0px 0px 4px 0px red', // Box shadow for active select box.
|
|
@@ -264,18 +306,18 @@ function CustomSelect(_ref) {
|
|
|
264
306
|
},
|
|
265
307
|
token: {
|
|
266
308
|
// controlOutline: '4px 4px 4px 4px red', // an attempt at applying box shadow
|
|
267
|
-
colorTextPlaceholder: _ColorVariablesMap.default[
|
|
309
|
+
colorTextPlaceholder: _ColorVariablesMap.default["--color-placeholder-text"],
|
|
268
310
|
// Color of placeholder text
|
|
269
|
-
colorTextQuaternary: _ColorVariablesMap.default[
|
|
311
|
+
colorTextQuaternary: _ColorVariablesMap.default["--color-secondary-content"],
|
|
270
312
|
// Color of dropdown arrow.
|
|
271
313
|
|
|
272
|
-
colorPrimary: _ColorVariablesMap.default[
|
|
314
|
+
colorPrimary: _ColorVariablesMap.default["--color-primary"],
|
|
273
315
|
// for active color of select
|
|
274
|
-
colorPrimaryHover: _ColorVariablesMap.default[
|
|
316
|
+
colorPrimaryHover: _ColorVariablesMap.default["--color-primary"],
|
|
275
317
|
// for hover color of select
|
|
276
|
-
borderRadius:
|
|
318
|
+
borderRadius: "4px",
|
|
277
319
|
// For border radius of select text field.
|
|
278
|
-
borderRadiusLG:
|
|
320
|
+
borderRadiusLG: "4px",
|
|
279
321
|
// For border radius of dropdown
|
|
280
322
|
controlHeight: 48,
|
|
281
323
|
// height of text field (tag height is half of this, i.e. 24px)
|
|
@@ -283,46 +325,56 @@ function CustomSelect(_ref) {
|
|
|
283
325
|
// height of small text field
|
|
284
326
|
|
|
285
327
|
// This controls padding of larger text box
|
|
286
|
-
controlPaddingHorizontalSM: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
328
|
+
controlPaddingHorizontalSM: (props === null || props === void 0 ? void 0 : props.size) === "small" ? 13 : 17,
|
|
287
329
|
// 1 extra so that it shows 12px and 16px in browser console.
|
|
288
|
-
paddingSM: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
330
|
+
paddingSM: (props === null || props === void 0 ? void 0 : props.size) === "small" ? 13 : 17,
|
|
289
331
|
// paddingSM is what determines padding of input box.
|
|
290
332
|
|
|
291
|
-
controlItemBgHover: _ColorVariablesMap.default[
|
|
333
|
+
controlItemBgHover: _ColorVariablesMap.default["--color-background-info"],
|
|
292
334
|
// hover color of items
|
|
293
|
-
colorBgElevated: _ColorVariablesMap.default[
|
|
335
|
+
colorBgElevated: _ColorVariablesMap.default["--color-primary-background"],
|
|
294
336
|
// background color of dropdown
|
|
295
337
|
// multipleItemHeight: 100,
|
|
296
|
-
colorBgContainerDisabled: _ColorVariablesMap.default[
|
|
338
|
+
colorBgContainerDisabled: _ColorVariablesMap.default["--color-divider"],
|
|
297
339
|
// background color of disabled select
|
|
298
|
-
colorBorder: _ColorVariablesMap.default[
|
|
299
|
-
colorFillSecondary: _ColorVariablesMap.default[
|
|
340
|
+
colorBorder: _ColorVariablesMap.default["--color-placeholder-text"],
|
|
341
|
+
colorFillSecondary: _ColorVariablesMap.default["--color-secondary-background"],
|
|
300
342
|
// background color for tags
|
|
301
343
|
|
|
302
|
-
colorText: _ColorVariablesMap.default[
|
|
344
|
+
colorText: _ColorVariablesMap.default["--color-primary-content"],
|
|
303
345
|
// Text color of unselected options in dropdown
|
|
304
|
-
colorTextDisabled: _ColorVariablesMap.default[
|
|
346
|
+
colorTextDisabled: _ColorVariablesMap.default["--color-secondary-content"],
|
|
305
347
|
// Text color when disabled
|
|
306
348
|
|
|
307
|
-
colorIcon: _ColorVariablesMap.default[
|
|
349
|
+
colorIcon: _ColorVariablesMap.default["--color-primary-content"],
|
|
308
350
|
// Color of cross icon
|
|
309
|
-
colorError: _ColorVariablesMap.default[
|
|
351
|
+
colorError: _ColorVariablesMap.default["--color-negative"],
|
|
310
352
|
// Error color
|
|
311
|
-
colorErrorBorderHover: _ColorVariablesMap.default[
|
|
353
|
+
colorErrorBorderHover: _ColorVariablesMap.default["--color-negative"],
|
|
312
354
|
// Hover error color should be same as error color
|
|
313
|
-
boxShadowSecondary: _Elevation.ElevationMap[
|
|
355
|
+
boxShadowSecondary: _Elevation.ElevationMap["elevation-white-1"] // Box shadow of dropdown.
|
|
314
356
|
}
|
|
315
357
|
}
|
|
316
358
|
}, /*#__PURE__*/_react.default.createElement(StyledSelect, _extends({
|
|
317
359
|
"data-test": dataTest,
|
|
318
360
|
dropdownStyle: {
|
|
319
|
-
padding:
|
|
361
|
+
padding: "0px"
|
|
320
362
|
},
|
|
321
363
|
mode: mode,
|
|
322
|
-
maxTagCount: (selectedOptions === null || selectedOptions === void 0 || (_selectedOptions$inde2 = selectedOptions.indexOf) === null || _selectedOptions$inde2 === void 0 ? void 0 : _selectedOptions$inde2.call(selectedOptions, allText)) === -1 ?
|
|
364
|
+
maxTagCount: (selectedOptions === null || selectedOptions === void 0 || (_selectedOptions$inde2 = selectedOptions.indexOf) === null || _selectedOptions$inde2 === void 0 ? void 0 : _selectedOptions$inde2.call(selectedOptions, allText)) === -1 ? "responsive" : 1,
|
|
323
365
|
maxTagPlaceholder: getMaxTagPlaceholder,
|
|
324
366
|
onDeselect: (0, _utils.isFunction)(onSelectionChange) ? value => onOptionsChange(false, value) : undefined,
|
|
325
|
-
onSelect: (0, _utils.isFunction)(onSelectionChange)
|
|
367
|
+
onSelect: (0, _utils.isFunction)(onSelectionChange) || (0, _utils.isFunction)(onCustomSelect) ? value => {
|
|
368
|
+
if ((0, _utils.isFunction)(onSelectionChange)) {
|
|
369
|
+
onOptionsChange(true, value);
|
|
370
|
+
}
|
|
371
|
+
if ((0, _utils.isFunction)(onCustomSelect)) {
|
|
372
|
+
const fullOption = options === null || options === void 0 ? void 0 : options.find(opt => opt.value === value);
|
|
373
|
+
if (fullOption) {
|
|
374
|
+
onCustomSelect(fullOption);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
} : undefined,
|
|
326
378
|
suffixIcon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
327
379
|
icon: _KeyboardArrowDown.default,
|
|
328
380
|
size: 20
|
|
@@ -333,13 +385,19 @@ function CustomSelect(_ref) {
|
|
|
333
385
|
placeholder: placeholder
|
|
334
386
|
}, props), allText && /*#__PURE__*/_react.default.createElement(Option, {
|
|
335
387
|
value: allText
|
|
336
|
-
}, allText), children || (actualOptions === null || actualOptions === void 0 ? void 0 : actualOptions.map(actualOption => {
|
|
388
|
+
}, allText), children || Array.isArray(actualOptions) && (actualOptions === null || actualOptions === void 0 ? void 0 : actualOptions.map(actualOption => {
|
|
337
389
|
var _actualOption$disable;
|
|
338
390
|
return /*#__PURE__*/_react.default.createElement(Option, {
|
|
339
391
|
disabled: (_actualOption$disable = actualOption.disabled) !== null && _actualOption$disable !== void 0 ? _actualOption$disable : false,
|
|
340
392
|
value: actualOption.value,
|
|
341
|
-
key: (0, _utils.getUUID)()
|
|
342
|
-
|
|
393
|
+
key: (0, _utils.getUUID)(),
|
|
394
|
+
label: actualOption.label
|
|
395
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actualOption.label, (actualOption === null || actualOption === void 0 ? void 0 : actualOption.subLabel) && /*#__PURE__*/_react.default.createElement("div", {
|
|
396
|
+
className: "margin-top-4"
|
|
397
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
398
|
+
typography: "type-b3-400",
|
|
399
|
+
color: "secondary-content"
|
|
400
|
+
}, actualOption === null || actualOption === void 0 ? void 0 : actualOption.subLabel))));
|
|
343
401
|
}))));
|
|
344
402
|
}
|
|
345
403
|
CustomSelect.Option = _antd.Select.Option;
|
|
@@ -347,8 +405,8 @@ CustomSelect.propTypes = {
|
|
|
347
405
|
allText: _propTypes.default.string,
|
|
348
406
|
children: _propTypes.default.node,
|
|
349
407
|
defaultValue: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string, _propTypes.default.number]),
|
|
350
|
-
|
|
351
|
-
mode: _propTypes.default.oneOf([
|
|
408
|
+
"data-test": _propTypes.default.string,
|
|
409
|
+
mode: _propTypes.default.oneOf(["multiple", "tags"]),
|
|
352
410
|
onSelectionChange: _propTypes.default.func,
|
|
353
411
|
options: _propTypes.default.arrayOf(
|
|
354
412
|
// Checked from antd's github
|
|
@@ -356,17 +414,19 @@ CustomSelect.propTypes = {
|
|
|
356
414
|
label: _propTypes.default.node,
|
|
357
415
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
|
|
358
416
|
})),
|
|
359
|
-
size: _propTypes.default.oneOf([
|
|
360
|
-
placeholder: _propTypes.default.string
|
|
417
|
+
size: _propTypes.default.oneOf(["small", "middle"]),
|
|
418
|
+
placeholder: _propTypes.default.string,
|
|
419
|
+
maxSelectForMultiSelect: _propTypes.default.number
|
|
361
420
|
};
|
|
362
421
|
CustomSelect.defaultProps = {
|
|
363
422
|
allText: null,
|
|
364
423
|
children: null,
|
|
365
424
|
defaultValue: [],
|
|
366
|
-
|
|
425
|
+
"data-test": null,
|
|
367
426
|
mode: null,
|
|
368
427
|
onSelectionChange: null,
|
|
369
428
|
options: [],
|
|
370
|
-
size:
|
|
371
|
-
placeholder:
|
|
429
|
+
size: "middle",
|
|
430
|
+
placeholder: "",
|
|
431
|
+
maxSelectForMultiSelect: null
|
|
372
432
|
};
|