oa-componentbook 1.0.1-stage.44 → 1.0.1-stage.440
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 +123 -43
- 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-button/styles.js +1 -1
- 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-modal/CustomModal.js +59 -48
- 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-progress-bar/CustomProgressBar.js +8 -4
- package/build/components/oa-component-select/CustomSelect.js +130 -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 +613 -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/CustomTextArea.js +161 -0
- package/build/components/oa-component-textarea/constants.js +39 -0
- package/build/components/oa-component-textarea/styles.js +12 -3
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +129 -42
- package/build/components/oa-component-viewer/CustomViewer.js +17 -11
- 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 +116 -29
- package/build/dev/oa-component-upload/styles.js +2 -2
- 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 +114 -2
- 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 +403 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +85 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2421 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +90 -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 +96 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +219 -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 +310 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +42 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +577 -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 +396 -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 +256 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- 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 +83 -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 +165 -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-select-list-item-modal/SelectListItemModal.js +91 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +175 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +63 -35
- package/build/widgets/oa-widget-track-shipment-list/fn.js +16 -4
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +407 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +4 -2
- package/build/components/oa-component-textarea/TextArea.js +0 -74
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.object.assign.js");
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
10
11
|
var _styles = require("./styles");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); } /* eslint-disable */
|
|
12
14
|
/**
|
|
13
15
|
* A simple tag component that displays a label.
|
|
14
16
|
*
|
|
@@ -21,28 +23,44 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
23
|
*/
|
|
22
24
|
function CustomTag(_ref) {
|
|
23
25
|
let {
|
|
24
|
-
|
|
26
|
+
"data-test": dataTest,
|
|
25
27
|
label,
|
|
26
28
|
type,
|
|
27
|
-
visible
|
|
29
|
+
visible,
|
|
30
|
+
bgColor,
|
|
31
|
+
borderColor,
|
|
32
|
+
textColor,
|
|
33
|
+
style
|
|
28
34
|
} = _ref;
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(_styles.StyledTag, {
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledTag, _extends({
|
|
30
36
|
"data-test": dataTest,
|
|
31
37
|
type: type,
|
|
32
|
-
visible: visible
|
|
33
|
-
|
|
38
|
+
visible: visible,
|
|
39
|
+
bgColor: bgColor,
|
|
40
|
+
borderColor: borderColor,
|
|
41
|
+
textColor: textColor
|
|
42
|
+
}, style && {
|
|
43
|
+
style
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.CenteredTextContainer, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
34
45
|
typography: "type-button-500"
|
|
35
46
|
}, label)));
|
|
36
47
|
}
|
|
37
48
|
CustomTag.propTypes = {
|
|
38
|
-
|
|
49
|
+
"data-test": _propTypes.default.string,
|
|
39
50
|
label: _propTypes.default.string.isRequired,
|
|
40
|
-
type: _propTypes.default.oneOf([
|
|
41
|
-
visible: _propTypes.default.bool
|
|
51
|
+
type: _propTypes.default.oneOf(["success", "pending", "failed", "recommended", "primary", "blue", "custom"]),
|
|
52
|
+
visible: _propTypes.default.bool,
|
|
53
|
+
bgColor: _propTypes.default.string,
|
|
54
|
+
borderColor: _propTypes.default.string,
|
|
55
|
+
textColor: _propTypes.default.string,
|
|
56
|
+
style: _propTypes.default.object
|
|
42
57
|
};
|
|
43
58
|
CustomTag.defaultProps = {
|
|
44
|
-
|
|
45
|
-
type:
|
|
46
|
-
visible: true
|
|
59
|
+
"data-test": null,
|
|
60
|
+
type: "",
|
|
61
|
+
visible: true,
|
|
62
|
+
bgColor: "",
|
|
63
|
+
borderColor: "",
|
|
64
|
+
textColor: ""
|
|
47
65
|
};
|
|
48
66
|
var _default = exports.default = CustomTag;
|
|
@@ -8,7 +8,13 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2;
|
|
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 getColorStyles =
|
|
11
|
+
const getColorStyles = props => {
|
|
12
|
+
const {
|
|
13
|
+
type,
|
|
14
|
+
bgColor,
|
|
15
|
+
borderColor,
|
|
16
|
+
textColor
|
|
17
|
+
} = props;
|
|
12
18
|
if (type === 'success') {
|
|
13
19
|
return {
|
|
14
20
|
backgroundColor: 'var(--color-background-positive)',
|
|
@@ -16,6 +22,13 @@ const getColorStyles = type => {
|
|
|
16
22
|
textColor: 'var(--color-positive)'
|
|
17
23
|
};
|
|
18
24
|
}
|
|
25
|
+
if (type === 'primary') {
|
|
26
|
+
return {
|
|
27
|
+
backgroundColor: 'var(--color-divider)',
|
|
28
|
+
borderColor: 'var(--color-placeholder-text)',
|
|
29
|
+
textColor: 'var(--color-primary-content)'
|
|
30
|
+
};
|
|
31
|
+
}
|
|
19
32
|
if (type === 'pending') {
|
|
20
33
|
return {
|
|
21
34
|
backgroundColor: 'var(--color-background-warning)',
|
|
@@ -37,6 +50,20 @@ const getColorStyles = type => {
|
|
|
37
50
|
textColor: 'var(--color-negative)'
|
|
38
51
|
};
|
|
39
52
|
}
|
|
53
|
+
if (type === 'blue') {
|
|
54
|
+
return {
|
|
55
|
+
backgroundColor: 'var(--color-background-info)',
|
|
56
|
+
borderColor: 'var(--color-primary)',
|
|
57
|
+
textColor: 'var(--color-primary)'
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (type === 'custom') {
|
|
61
|
+
return {
|
|
62
|
+
backgroundColor: bgColor,
|
|
63
|
+
borderColor,
|
|
64
|
+
textColor
|
|
65
|
+
};
|
|
66
|
+
}
|
|
40
67
|
return {
|
|
41
68
|
backgroundColor: '#CCCCCC',
|
|
42
69
|
borderColor: 'var(--color-primary-content)',
|
|
@@ -44,5 +71,5 @@ const getColorStyles = type => {
|
|
|
44
71
|
};
|
|
45
72
|
};
|
|
46
73
|
var _default = exports.default = {};
|
|
47
|
-
const StyledTag = exports.StyledTag = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n padding: 1px 12px;\n
|
|
48
|
-
const CenteredTextContainer = exports.CenteredTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
74
|
+
const StyledTag = exports.StyledTag = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n padding: 1px 12px;\n\n color: ", ";\n\n background-color: ", ";\n\n border: 1px solid ", ";\n border-radius: 4px;\n\n visibility: ", ";\n"])), props => getColorStyles(props).textColor, props => getColorStyles(props).backgroundColor, props => getColorStyles(props).borderColor, props => props.visible ? 'visible' : 'hidden');
|
|
75
|
+
const CenteredTextContainer = exports.CenteredTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex; white-space: nowrap;\n"])));
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.default = void 0;
|
|
10
|
+
require("core-js/modules/es.string.trim.js");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _SendRounded = _interopRequireDefault(require("@material-ui/icons/SendRounded"));
|
|
15
|
+
var _styles = _interopRequireWildcard(require("./styles"));
|
|
16
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
17
|
+
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
18
|
+
var _constants = require("./constants");
|
|
19
|
+
const _excluded = ["rows", "placeholder", "maxLength", "className", "variant"],
|
|
20
|
+
_excluded2 = ["minRows", "maxRows", "sendIconConfig", "onSend", "value", "onChange", "disabled"];
|
|
21
|
+
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); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
/**
|
|
28
|
+
* A custom text area component.
|
|
29
|
+
*
|
|
30
|
+
* The component includes the following properties:
|
|
31
|
+
* - `rows`: The number of rows for the text area (used for default variant).
|
|
32
|
+
* - `placeholder`: The placeholder text for the text area.
|
|
33
|
+
* - `maxLength`: The maximum length of the input value.
|
|
34
|
+
* - `className`: Additional CSS class to apply to the text area.
|
|
35
|
+
* - `variant`: 'default' or 'gradient' - determines the styling variant.
|
|
36
|
+
* - `minRows`: Initial line height for gradient variant (default: 1).
|
|
37
|
+
* - `maxRows`: Maximum rows before scrolling starts for gradient variant (default: null for unlimited).
|
|
38
|
+
* - `sendIconConfig`: Object with `show` (boolean, default: false) and `disabled` (boolean, default: false) for gradient variant only.
|
|
39
|
+
* - `onSend`: Callback function called when send icon is clicked (gradient variant only).
|
|
40
|
+
* - `antDesignProps`: Any other props to pass to the antd Input.TextArea component.
|
|
41
|
+
*
|
|
42
|
+
* The component will apply the following styles:
|
|
43
|
+
* - A dark grey background when the component is disabled.
|
|
44
|
+
* - A dark grey text color when the component is disabled.
|
|
45
|
+
* - A custom style class of `custom-textarea` to the outer element.
|
|
46
|
+
* - Gradient border and auto-growing height for gradient variant.
|
|
47
|
+
*
|
|
48
|
+
* The component will also apply the following props to the antd Input.TextArea component:
|
|
49
|
+
* - `rows` (for default variant) or `minRows`/`maxRows` (for gradient variant)
|
|
50
|
+
* - `placeholder`
|
|
51
|
+
* - `maxLength`
|
|
52
|
+
* - `className` (appended to the outer element)
|
|
53
|
+
* - Any other props passed in the `antDesignProps` object
|
|
54
|
+
*/
|
|
55
|
+
function CustomTextArea(_ref) {
|
|
56
|
+
let {
|
|
57
|
+
rows,
|
|
58
|
+
placeholder,
|
|
59
|
+
maxLength,
|
|
60
|
+
className,
|
|
61
|
+
variant = 'default'
|
|
62
|
+
} = _ref,
|
|
63
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
64
|
+
// Render gradient variant
|
|
65
|
+
if (variant === 'gradient') {
|
|
66
|
+
// Extract gradient-specific props from antDesignProps
|
|
67
|
+
const _ref2 = antDesignProps || {},
|
|
68
|
+
{
|
|
69
|
+
minRows = _constants.DEFAULT_MIN_ROWS,
|
|
70
|
+
maxRows = _constants.DEFAULT_MAX_ROWS,
|
|
71
|
+
sendIconConfig = _constants.DEFAULT_SEND_ICON_CONFIG,
|
|
72
|
+
onSend,
|
|
73
|
+
value,
|
|
74
|
+
onChange,
|
|
75
|
+
disabled
|
|
76
|
+
} = _ref2,
|
|
77
|
+
restAntDesignProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
78
|
+
|
|
79
|
+
// Handle send icon click - gradient variant only
|
|
80
|
+
// Use value prop directly - no internal state management
|
|
81
|
+
const handleSendClick = () => {
|
|
82
|
+
const currentValue = value || '';
|
|
83
|
+
// Only allow click if textarea is enabled, icon config is not disabled, and has content
|
|
84
|
+
if (onSend && !disabled && !sendIconConfig.disabled && currentValue.trim()) {
|
|
85
|
+
onSend(currentValue);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Determine if send icon should be enabled - gradient variant only
|
|
90
|
+
// Icon is enabled if: textarea is enabled AND config says it's not disabled AND there's content
|
|
91
|
+
// Use value prop directly - no internal state
|
|
92
|
+
const currentValue = value || '';
|
|
93
|
+
const isSendEnabled = !disabled && !sendIconConfig.disabled && currentValue.trim().length > 0;
|
|
94
|
+
|
|
95
|
+
// Determine if icon should be shown - only for gradient variant
|
|
96
|
+
// Hidden by default, only show when explicitly requested via sendIconConfig.show
|
|
97
|
+
const shouldShowIcon = sendIconConfig.show;
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
99
|
+
theme: {
|
|
100
|
+
token: {
|
|
101
|
+
colorBgContainerDisabled: _ColorVariablesMap.default['--color-divider'],
|
|
102
|
+
colorTextDisabled: _ColorVariablesMap.default['--color-secondary-content']
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.TextAreaWrapper, {
|
|
106
|
+
className: className,
|
|
107
|
+
$disabled: disabled
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.default, _extends({
|
|
109
|
+
placeholder: placeholder,
|
|
110
|
+
maxLength: maxLength,
|
|
111
|
+
className: "custom-textarea-gradient",
|
|
112
|
+
value: value,
|
|
113
|
+
onChange: onChange,
|
|
114
|
+
disabled: disabled,
|
|
115
|
+
autoSize: maxRows ? {
|
|
116
|
+
minRows,
|
|
117
|
+
maxRows
|
|
118
|
+
} : {
|
|
119
|
+
minRows
|
|
120
|
+
}
|
|
121
|
+
}, restAntDesignProps)), shouldShowIcon && /*#__PURE__*/_react.default.createElement(_styles.SendIconWrapper, {
|
|
122
|
+
className: disabled || sendIconConfig.disabled || !isSendEnabled ? 'icon-disabled' : 'icon-enabled'
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
124
|
+
icon: _SendRounded.default,
|
|
125
|
+
size: 24,
|
|
126
|
+
color: isSendEnabled ? 'primary' : 'placeholder-text',
|
|
127
|
+
onClick: handleSendClick
|
|
128
|
+
}))));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Render default variant (existing behavior - completely unchanged)
|
|
132
|
+
// All props including value, onChange pass through naturally via antDesignProps
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
134
|
+
theme: {
|
|
135
|
+
token: {
|
|
136
|
+
colorBgContainerDisabled: _ColorVariablesMap.default['--color-divider'],
|
|
137
|
+
colorTextDisabled: _ColorVariablesMap.default['--color-secondary-content']
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.default, _extends({
|
|
141
|
+
rows: rows,
|
|
142
|
+
placeholder: placeholder,
|
|
143
|
+
maxLength: maxLength,
|
|
144
|
+
className: "custom-textarea ".concat(className)
|
|
145
|
+
}, antDesignProps)));
|
|
146
|
+
}
|
|
147
|
+
CustomTextArea.propTypes = {
|
|
148
|
+
rows: _propTypes.default.number,
|
|
149
|
+
placeholder: _propTypes.default.string,
|
|
150
|
+
maxLength: _propTypes.default.number,
|
|
151
|
+
className: _propTypes.default.string,
|
|
152
|
+
variant: _propTypes.default.oneOf(['default', 'gradient'])
|
|
153
|
+
};
|
|
154
|
+
CustomTextArea.defaultProps = {
|
|
155
|
+
rows: _constants.DEFAULT_ROWS,
|
|
156
|
+
placeholder: null,
|
|
157
|
+
maxLength: 5000,
|
|
158
|
+
className: '',
|
|
159
|
+
variant: 'default'
|
|
160
|
+
};
|
|
161
|
+
var _default = exports.default = CustomTextArea;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TEXTAREA_SHADOW = exports.TEXTAREA_BORDER_RADIUS = exports.SEND_ICON_SIZE = exports.GRADIENT_BORDER_COLORS = exports.DEFAULT_SEND_ICON_CONFIG = exports.DEFAULT_ROWS = exports.DEFAULT_MIN_ROWS = exports.DEFAULT_MAX_ROWS = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Constants for CustomTextArea component
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Default values for textarea configuration
|
|
12
|
+
const DEFAULT_MIN_ROWS = exports.DEFAULT_MIN_ROWS = 1;
|
|
13
|
+
const DEFAULT_MAX_ROWS = exports.DEFAULT_MAX_ROWS = null; // null means unlimited growth
|
|
14
|
+
const DEFAULT_ROWS = exports.DEFAULT_ROWS = 2;
|
|
15
|
+
|
|
16
|
+
// Gradient border colors
|
|
17
|
+
const GRADIENT_BORDER_COLORS = exports.GRADIENT_BORDER_COLORS = {
|
|
18
|
+
top: '#0098FF',
|
|
19
|
+
// Blue
|
|
20
|
+
middle: '#9A6CFF',
|
|
21
|
+
// Purple
|
|
22
|
+
bottom: '#FB6252' // Coral/Orange-Red
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Shadow styles
|
|
26
|
+
const TEXTAREA_SHADOW = exports.TEXTAREA_SHADOW = '0px 2px 10px rgba(0, 0, 0, 0.14)';
|
|
27
|
+
|
|
28
|
+
// Border radius
|
|
29
|
+
const TEXTAREA_BORDER_RADIUS = exports.TEXTAREA_BORDER_RADIUS = '12px';
|
|
30
|
+
|
|
31
|
+
// Icon sizes
|
|
32
|
+
const SEND_ICON_SIZE = exports.SEND_ICON_SIZE = 24;
|
|
33
|
+
|
|
34
|
+
// Default send icon configuration
|
|
35
|
+
const DEFAULT_SEND_ICON_CONFIG = exports.DEFAULT_SEND_ICON_CONFIG = {
|
|
36
|
+
show: false,
|
|
37
|
+
// Hidden by default - only show when explicitly requested
|
|
38
|
+
disabled: false
|
|
39
|
+
};
|
|
@@ -3,14 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.TextAreaWrapper = exports.SendIconWrapper = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _antd = require("antd");
|
|
9
|
-
var
|
|
9
|
+
var _constants = require("./constants");
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
13
|
const {
|
|
13
14
|
TextArea: AntdTextArea
|
|
14
15
|
} = _antd.Input;
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
// Default textarea styles (existing)
|
|
18
|
+
const StyledTextArea = (0, _styledComponents.default)(AntdTextArea)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.custom-textarea {\n padding: 16px;\n resize: none;\n border-radius: 4px;\n max-height: 92px;\n border: 1px solid var(--color-placeholder-text);\n }\n &.custom-textarea:hover {\n border: 1px solid var(--color-primary);\n }\n &.custom-textarea:focus-within {\n box-shadow: 0px 0px 4px 0px rgba(1, 79, 197, 0.90);\n }\n\n /* Gradient variant styles */\n &.custom-textarea-gradient {\n padding: 16px 48px 16px 16px;\n resize: none;\n border-radius: calc(", " - 2px);\n border: none;\n background: var(--color-primary-background);\n font-size: 16px;\n line-height: 24px;\n color: var(--color-primary-content);\n min-height: auto !important;\n box-shadow: none;\n width: 100%;\n }\n\n &.custom-textarea-gradient::placeholder {\n color: var(--color-secondary-content);\n }\n\n &.custom-textarea-gradient:hover {\n box-shadow: none;\n }\n\n &.custom-textarea-gradient:focus {\n outline: none;\n box-shadow: none;\n }\n\n &.custom-textarea-gradient:focus-within {\n box-shadow: none;\n }\n"])), _constants.TEXTAREA_BORDER_RADIUS);
|
|
19
|
+
|
|
20
|
+
// Wrapper for gradient variant with gradient border
|
|
21
|
+
const TextAreaWrapper = exports.TextAreaWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n display: block;\n width: 100%;\n border-radius: ", ";\n padding: 2px;\n background: ", ";\n box-shadow: ", ";\n opacity: ", ";\n"])), _constants.TEXTAREA_BORDER_RADIUS, props => props.$disabled ? 'var(--color-divider)' : "linear-gradient(\n 135deg,\n ".concat(_constants.GRADIENT_BORDER_COLORS.top, " 0%,\n ").concat(_constants.GRADIENT_BORDER_COLORS.middle, " 50%,\n ").concat(_constants.GRADIENT_BORDER_COLORS.bottom, " 100%\n )"), props => props.$disabled ? 'none' : _constants.TEXTAREA_SHADOW, props => props.$disabled ? 0.6 : 1);
|
|
22
|
+
|
|
23
|
+
// Send icon wrapper positioned absolutely
|
|
24
|
+
const SendIconWrapper = exports.SendIconWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 18px;\n right: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n pointer-events: none;\n\n button,\n svg {\n pointer-events: auto;\n }\n\n /* Icon disabled state */\n &.icon-disabled {\n opacity: 0.5;\n \n button,\n svg {\n cursor: not-allowed;\n }\n }\n\n /* Icon enabled state */\n &.icon-enabled {\n opacity: 1;\n \n button,\n svg {\n cursor: pointer;\n }\n }\n"])));
|
|
16
25
|
var _default = exports.default = StyledTextArea;
|
|
@@ -10,7 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _antd = require("antd");
|
|
11
11
|
var _tooltipPlacementOption = require("../../global-css/tooltip-placement-option");
|
|
12
12
|
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
13
|
-
const _excluded = ["title", "placement", "children", "data-test"];
|
|
13
|
+
const _excluded = ["title", "placement", "children", "mode", "data-test"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
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); }
|
|
16
16
|
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; }
|
|
@@ -30,6 +30,7 @@ function CustomTooltip(_ref) {
|
|
|
30
30
|
title,
|
|
31
31
|
placement,
|
|
32
32
|
children,
|
|
33
|
+
mode,
|
|
33
34
|
'data-test': dataTest
|
|
34
35
|
} = _ref,
|
|
35
36
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -49,18 +50,21 @@ function CustomTooltip(_ref) {
|
|
|
49
50
|
}, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, _extends({
|
|
50
51
|
title: title,
|
|
51
52
|
placement: placement,
|
|
52
|
-
"data-test": dataTest
|
|
53
|
+
"data-test": dataTest,
|
|
54
|
+
overlayClassName: mode === 'light' ? 'customLightTooltip' : ''
|
|
53
55
|
}, antDesignProps), children));
|
|
54
56
|
}
|
|
55
57
|
CustomTooltip.propTypes = {
|
|
56
58
|
title: _propTypes.default.node.isRequired,
|
|
57
59
|
placement: _propTypes.default.oneOf(_tooltipPlacementOption.tooltipPlacementOptions),
|
|
58
60
|
children: _propTypes.default.node,
|
|
59
|
-
'data-test': _propTypes.default.string
|
|
61
|
+
'data-test': _propTypes.default.string,
|
|
62
|
+
mode: _propTypes.default.oneOf(['light', 'dark'])
|
|
60
63
|
};
|
|
61
64
|
CustomTooltip.defaultProps = {
|
|
62
65
|
placement: 'top',
|
|
63
66
|
children: null,
|
|
64
|
-
'data-test': null
|
|
67
|
+
'data-test': null,
|
|
68
|
+
mode: 'dark'
|
|
65
69
|
};
|
|
66
70
|
var _default = exports.default = CustomTooltip;
|