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.
Files changed (135) hide show
  1. package/build/components/oa-component-accordion/Accordion.js +129 -40
  2. package/build/components/oa-component-accordion/styles.js +2 -2
  3. package/build/components/oa-component-button/CustomButton.js +24 -19
  4. package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
  5. package/build/components/oa-component-checkbox/styles.js +1 -1
  6. package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
  7. package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
  8. package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
  9. package/build/components/oa-component-icons/MaterialIcon.js +1 -1
  10. package/build/components/oa-component-info/CustomInfo.js +9 -4
  11. package/build/components/oa-component-info/styles.js +3 -3
  12. package/build/components/oa-component-modal/styles.js +3 -2
  13. package/build/components/oa-component-pagination/CustomPagination.js +111 -0
  14. package/build/components/oa-component-pagination/styles.js +12 -0
  15. package/build/components/oa-component-select/CustomSelect.js +116 -56
  16. package/build/components/oa-component-steps/CustomSteps.js +117 -0
  17. package/build/components/oa-component-steps/styles.js +12 -0
  18. package/build/components/oa-component-table/CustomTable.js +28 -5
  19. package/build/components/oa-component-table/CustomTableV1.js +610 -0
  20. package/build/components/oa-component-table/styles.js +1 -1
  21. package/build/components/oa-component-table/stylesV1.js +19 -0
  22. package/build/components/oa-component-tabs/CustomTabs.js +1 -1
  23. package/build/components/oa-component-tag/CustomTag.js +29 -11
  24. package/build/components/oa-component-tag/styles.js +30 -3
  25. package/build/components/oa-component-textarea/{TextArea.js → CustomTextArea.js} +4 -4
  26. package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
  27. package/build/components/oa-component-upload/CustomUpload.js +120 -40
  28. package/build/components/oa-component-viewer/CustomViewer.js +3 -1
  29. package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
  30. package/build/dev/oa-component-document-viewer/styles.js +12 -0
  31. package/build/dev/oa-component-upload/CustomUpload.js +3 -0
  32. package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
  33. package/build/dev/oa-widget-document-modal/styles.js +12 -0
  34. package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
  35. package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
  36. package/build/global-css/GlobalCss.js +2 -1
  37. package/build/global-css/GridLayout.js +1 -1
  38. package/build/global-css/commonStyles.js +11 -0
  39. package/build/images/Car.png +0 -0
  40. package/build/images/TwoWheeler.png +0 -0
  41. package/build/images/astronaut_emptystate.png +0 -0
  42. package/build/images/exportGrp01.png +0 -0
  43. package/build/images/exportGrp02.png +0 -0
  44. package/build/images/exportGrp03.png +0 -0
  45. package/build/images/outOfStock.png +0 -0
  46. package/build/index.js +110 -5
  47. package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
  48. package/build/layout/DetailDataLayout/components/Form.js +22 -0
  49. package/build/layout/DetailDataLayout/components/Header.js +32 -0
  50. package/build/layout/DetailDataLayout/style.css +9 -0
  51. package/build/layout/DetailDataLayout/styles.js +12 -0
  52. package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +235 -0
  53. package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +63 -0
  54. package/build/layout/EntityOverviewLayout/styles.js +13 -0
  55. package/build/layout/GenricLayOut/GenricLayOut.js +2293 -0
  56. package/build/layout/GenricLayOut/components/AppliedFilters.js +84 -0
  57. package/build/layout/GenricLayOut/components/CardList.js +34 -0
  58. package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
  59. package/build/layout/GenricLayOut/components/Header.js +74 -0
  60. package/build/layout/GenricLayOut/components/Modal.js +85 -0
  61. package/build/layout/GenricLayOut/components/ProfileSection.js +87 -0
  62. package/build/layout/GenricLayOut/components/Search.js +51 -0
  63. package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
  64. package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
  65. package/build/layout/GenricLayOut/reducer/layoutReducer.js +294 -0
  66. package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
  67. package/build/layout/GenricLayOut/styles.js +25 -0
  68. package/build/utils/download-file.js +23 -0
  69. package/build/widgets/oa-form-widget/FormWidget.js +544 -0
  70. package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
  71. package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
  72. package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
  73. package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
  74. package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
  75. package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
  76. package/build/widgets/oa-widget-approval/styles.js +2 -2
  77. package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
  78. package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
  79. package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +395 -0
  80. package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
  81. package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
  82. package/build/widgets/oa-widget-content-panel/styles.js +12 -0
  83. package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
  84. package/build/widgets/oa-widget-detailcard/styles.js +1 -1
  85. package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
  86. package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
  87. package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
  88. package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
  89. package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
  90. package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
  91. package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
  92. package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
  93. package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +149 -64
  94. package/build/widgets/oa-widget-image-carousel/styles.js +16 -5
  95. package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
  96. package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
  97. package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
  98. package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
  99. package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
  100. package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
  101. package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +77 -0
  102. package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
  103. package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
  104. package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
  105. package/build/widgets/oa-widget-key-value/styles.js +1 -1
  106. package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
  107. package/build/widgets/oa-widget-kpi/styles.js +12 -0
  108. package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
  109. package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
  110. package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
  111. package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
  112. package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
  113. package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
  114. package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
  115. package/build/widgets/oa-widget-notes/styles.js +4 -3
  116. package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -0
  117. package/build/widgets/oa-widget-profile-data/styles.js +13 -0
  118. package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
  119. package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
  120. package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
  121. package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
  122. package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
  123. package/build/widgets/oa-widget-sidebar/SidebarWidget.js +105 -0
  124. package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
  125. package/build/widgets/oa-widget-sidebar/sidebar.css +0 -0
  126. package/build/widgets/oa-widget-sidebar/styles.js +13 -0
  127. package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +57 -29
  128. package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +28 -6
  129. package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +103 -0
  130. package/build/widgets/oa-widget-track-shipment-list/fn.js +81 -0
  131. package/build/widgets/oa-widget-user-management/UserManagementWidget.js +352 -0
  132. package/build/widgets/oa-widget-user-management/styles.js +15 -0
  133. package/package.json +3 -1
  134. package/build/dev/oa-widget-track-shipment/TrackShipmentWidget.js +0 -195
  135. /package/build/{dev/oa-widget-track-shipment → widgets/oa-widget-track-shipment-list}/styles.js +0 -0
@@ -0,0 +1,544 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.description.js");
4
+ require("core-js/modules/es.object.assign.js");
5
+ require("core-js/modules/es.weak-map.js");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.default = FormWidget;
10
+ require("core-js/modules/web.dom-collections.iterator.js");
11
+ require("core-js/modules/es.regexp.constructor.js");
12
+ require("core-js/modules/es.regexp.exec.js");
13
+ require("core-js/modules/es.regexp.to-string.js");
14
+ require("core-js/modules/es.array.includes.js");
15
+ require("core-js/modules/es.string.includes.js");
16
+ var _antd = require("antd");
17
+ var _react = _interopRequireWildcard(require("react"));
18
+ var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
19
+ var _CustomDatePicker = _interopRequireDefault(require("../../components/oa-component-datepicker/CustomDatePicker"));
20
+ var _CustomInput = _interopRequireDefault(require("../../components/oa-component-input/CustomInput"));
21
+ var _CustomSelect = _interopRequireDefault(require("../../components/oa-component-select/CustomSelect"));
22
+ var _CustomTextArea = _interopRequireDefault(require("../../components/oa-component-textarea/CustomTextArea"));
23
+ var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
24
+ var _CustomUpload = _interopRequireDefault(require("../../components/oa-component-upload/CustomUpload"));
25
+ var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
26
+ var _ItemInfoCardWidget = _interopRequireDefault(require("../oa-widget-item-info-card/ItemInfoCardWidget"));
27
+ var _KeyValueWidget = _interopRequireDefault(require("../oa-widget-key-value/KeyValueWidget"));
28
+ var _CustomCheckBox = _interopRequireDefault(require("../../components/oa-component-checkbox/CustomCheckBox"));
29
+ var _CustomRadio = _interopRequireDefault(require("../../components/oa-component-radio/CustomRadio"));
30
+ var _FormWidgetStyle = require("./FormWidgetStyle");
31
+ var _styles = require("../../layout/GenricLayOut/styles");
32
+ var _CustomTag = _interopRequireDefault(require("../../components/oa-component-tag/CustomTag"));
33
+ var _CustomInfo = _interopRequireDefault(require("../../components/oa-component-info/CustomInfo"));
34
+ var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
35
+ var _CustomTooltip = _interopRequireDefault(require("../../components/oa-component-tooltip/CustomTooltip"));
36
+ var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined"));
37
+ var _InfoRounded = _interopRequireDefault(require("@material-ui/icons/InfoRounded"));
38
+ var _CollapsibleKeyValueWidget = _interopRequireDefault(require("../oa-widget-collapsible-key-value/CollapsibleKeyValueWidget"));
39
+ var _UserManagementWidget = _interopRequireDefault(require("../oa-widget-user-management/UserManagementWidget"));
40
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
+ 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); }
42
+ 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; }
43
+ 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); }
44
+ 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; }
45
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
46
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
47
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
48
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable */
49
+ function FormWidget(props) {
50
+ var _cancel$type, _cancel$size, _clear$type, _clear$size, _submit$type, _submit$disabled;
51
+ const [form] = _antd.Form.useForm();
52
+ const [dynamicRules, setDynamicRules] = (0, _react.useState)({});
53
+ const {
54
+ groups,
55
+ cta,
56
+ handleDrawerFormOnFinish,
57
+ downloadFileOnS3,
58
+ generateS3Url,
59
+ uploadOnS3,
60
+ handleCollapsibleKeyData
61
+ } = props;
62
+ const {
63
+ cancel,
64
+ submit,
65
+ visible,
66
+ clear
67
+ } = cta !== null && cta !== void 0 ? cta : {};
68
+ const getFieldRules = (itemData, item) => {
69
+ if (item.customRulesCheck) {
70
+ return dynamicRules[item === null || item === void 0 ? void 0 : item.name] || (item === null || item === void 0 ? void 0 : item.rules) || [];
71
+ } else {
72
+ return getInputRules(itemData, item);
73
+ }
74
+ };
75
+ const modifedRuleWithItem = item => {
76
+ const temp = item === null || item === void 0 ? void 0 : item.map(r => {
77
+ if (!(r !== null && r !== void 0 && r.checkValidator) || !(r !== null && r !== void 0 && r.rule)) {
78
+ return null;
79
+ }
80
+ let pattern = r.rule.pattern;
81
+ if (typeof pattern === "string") {
82
+ const regex = new RegExp(pattern);
83
+ pattern = regex;
84
+ }
85
+ return _objectSpread(_objectSpread({}, r.rule), {}, {
86
+ pattern
87
+ });
88
+ }).filter(Boolean);
89
+ return temp;
90
+ };
91
+ const getInputRules = (itemData, item) => {
92
+ var _ref;
93
+ if (itemData !== null && itemData !== void 0 && itemData.customRules) {
94
+ for (const key in itemData === null || itemData === void 0 ? void 0 : itemData.customRules) {
95
+ if (item[key]) {
96
+ const modifiedRules = modifedRuleWithItem(itemData === null || itemData === void 0 ? void 0 : itemData.customRules[key]);
97
+ return modifiedRules;
98
+ }
99
+ }
100
+ }
101
+ const itemRules = (_ref = itemData || item) === null || _ref === void 0 ? void 0 : _ref.rules;
102
+ return modifedRuleWithItem(itemRules);
103
+ };
104
+ const handleDynamicRuleUpdate = (fieldName, value, dynamicRulesConfig) => {
105
+ if (!dynamicRulesConfig) return;
106
+ Object.entries(dynamicRulesConfig).forEach(_ref2 => {
107
+ var _config$conditions;
108
+ let [targetField, config] = _ref2;
109
+ const condition = (_config$conditions = config.conditions) === null || _config$conditions === void 0 ? void 0 : _config$conditions.find(c => c.type === "equals" ? value == c.value : c.type == "not_equals" ? value != c.value : c.type == "includes" ? value === null || value === void 0 ? void 0 : value.includes(c.value) : c.validator ? c.validator(value) : false);
110
+ const newRules = condition ? condition.rules : config.defaultRules || [];
111
+ setDynamicRules(prev => _objectSpread(_objectSpread({}, prev), {}, {
112
+ [targetField]: newRules
113
+ }));
114
+ if (condition !== null && condition !== void 0 && condition.clearField) {
115
+ form.setFieldsValue({
116
+ [targetField]: undefined
117
+ });
118
+ }
119
+ });
120
+ };
121
+ const dynamicClassInCaseOfUpload = item => {
122
+ if ((item === null || item === void 0 ? void 0 : item.width) === "full") {
123
+ return "cstUplaodWithFullWidth";
124
+ } else if (item !== null && item !== void 0 && item.heading) {
125
+ if ((item === null || item === void 0 ? void 0 : item.headingVariant) === "top") return "cstUplaodWithTextTop";
126
+ return "cstUplaodWithText";
127
+ }
128
+ };
129
+ const renderLabelWithTooltip = (label, tooltip) => {
130
+ if (!tooltip) return label;
131
+ return /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.TooltipLabel, null, /*#__PURE__*/_react.default.createElement("span", null, label), /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
132
+ title: tooltip,
133
+ placement: "top"
134
+ }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
135
+ color: "primary-content",
136
+ size: 20,
137
+ icon: _InfoRounded.default
138
+ })));
139
+ };
140
+ const renderFieldWidget = (item, index, itemData) => {
141
+ if ((item === null || item === void 0 ? void 0 : item.widget) === "date" && (item === null || item === void 0 ? void 0 : item.visible) !== false) {
142
+ var _item$props, _item$props$getDisabl, _item$disabled;
143
+ return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
144
+ value: item === null || item === void 0 ? void 0 : item.value,
145
+ name: item === null || item === void 0 ? void 0 : item.name,
146
+ label: item === null || item === void 0 ? void 0 : item.label,
147
+ rules: item === null || item === void 0 ? void 0 : item.rules,
148
+ extra: item === null || item === void 0 ? void 0 : item.helpText,
149
+ initialValue: item === null || item === void 0 ? void 0 : item.defaultValue
150
+ }, /*#__PURE__*/_react.default.createElement(_CustomDatePicker.default, _extends({
151
+ style: {
152
+ width: "100%"
153
+ },
154
+ disabledDateFunction: item === null || item === void 0 || (_item$props = item.props) === null || _item$props === void 0 || (_item$props$getDisabl = _item$props.getDisabledDateLogic) === null || _item$props$getDisabl === void 0 ? void 0 : _item$props$getDisabl.call(_item$props, item.valueProp),
155
+ disabled: (_item$disabled = item.disabled) !== null && _item$disabled !== void 0 ? _item$disabled : false,
156
+ defaultValue: item.defaultValue
157
+ }, item === null || item === void 0 ? void 0 : item.props)));
158
+ }
159
+ if ((item === null || item === void 0 ? void 0 : item.widget) === "select" && (item === null || item === void 0 ? void 0 : item.visible) !== false) {
160
+ var _item$disabled2, _item$showSearch, _item$optionLabelProp;
161
+ return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
162
+ name: item === null || item === void 0 ? void 0 : item.name,
163
+ label: item === null || item === void 0 ? void 0 : item.label,
164
+ rules: item === null || item === void 0 ? void 0 : item.rules,
165
+ initialValue: item.defaultValueRequired ? item === null || item === void 0 ? void 0 : item.defaultValue : undefined
166
+ }, /*#__PURE__*/_react.default.createElement(_CustomSelect.default, _extends({
167
+ options: item === null || item === void 0 ? void 0 : item.value,
168
+ placeholder: item === null || item === void 0 ? void 0 : item.placeholder,
169
+ defaultValue: item.defaultValueRequired && (item === null || item === void 0 ? void 0 : item.defaultValue) !== "" ? item === null || item === void 0 ? void 0 : item.defaultValue : undefined,
170
+ disabled: (_item$disabled2 = item.disabled) !== null && _item$disabled2 !== void 0 ? _item$disabled2 : false
171
+ }, (item === null || item === void 0 ? void 0 : item.onChange) && {
172
+ onChange: value => {
173
+ // Call the original onChange if provided
174
+ if (item.onChange) {
175
+ item.onChange(value);
176
+ }
177
+
178
+ // Handle dynamic rule updates using generic approach
179
+ if (item.dynamicRules) {
180
+ handleDynamicRuleUpdate(item.name, value, item.dynamicRules);
181
+ }
182
+ }
183
+ }, {
184
+ onCustomSelect: arg => {
185
+ if (typeof (props === null || props === void 0 ? void 0 : props.onSelectHandlers) === "function") {
186
+ props.onSelectHandlers(arg, item === null || item === void 0 ? void 0 : item.key, item === null || item === void 0 ? void 0 : item.action);
187
+ }
188
+ },
189
+ showSearch: (_item$showSearch = item === null || item === void 0 ? void 0 : item.showSearch) !== null && _item$showSearch !== void 0 ? _item$showSearch : false,
190
+ filterOption: (input, option) => {
191
+ var _toLowerCase, _ref3, _option$label$props$t, _option$label, _input$toLowerCase;
192
+ return (_toLowerCase = (_ref3 = (_option$label$props$t = option === null || option === void 0 || (_option$label = option.label) === null || _option$label === void 0 || (_option$label = _option$label.props) === null || _option$label === void 0 ? void 0 : _option$label.title) !== null && _option$label$props$t !== void 0 ? _option$label$props$t : "").toLowerCase) === null || _toLowerCase === void 0 || (_toLowerCase = _toLowerCase.call(_ref3)) === null || _toLowerCase === void 0 ? void 0 : _toLowerCase.includes(input === null || input === void 0 || (_input$toLowerCase = input.toLowerCase) === null || _input$toLowerCase === void 0 ? void 0 : _input$toLowerCase.call(input));
193
+ }
194
+ }, item.optionLabelProp && {
195
+ optionLabelProp: (_item$optionLabelProp = item === null || item === void 0 ? void 0 : item.optionLabelProp) !== null && _item$optionLabelProp !== void 0 ? _item$optionLabelProp : ""
196
+ })));
197
+ }
198
+ if ((item === null || item === void 0 ? void 0 : item.widget) === "textArea") {
199
+ var _item$disabled3;
200
+ return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
201
+ name: item === null || item === void 0 ? void 0 : item.name,
202
+ label: item === null || item === void 0 ? void 0 : item.label,
203
+ rules: item === null || item === void 0 ? void 0 : item.rules
204
+ }, /*#__PURE__*/_react.default.createElement(_CustomTextArea.default, {
205
+ rows: 4,
206
+ disabled: (_item$disabled3 = item.disabled) !== null && _item$disabled3 !== void 0 ? _item$disabled3 : false,
207
+ placeholder: item === null || item === void 0 ? void 0 : item.placeholder
208
+ }));
209
+ }
210
+ if ((item === null || item === void 0 ? void 0 : item.widget) === "radio" && (item === null || item === void 0 ? void 0 : item.visible) !== false) {
211
+ return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
212
+ name: item === null || item === void 0 ? void 0 : item.name,
213
+ initialValue: item === null || item === void 0 ? void 0 : item.defaultValue,
214
+ label: item === null || item === void 0 ? void 0 : item.label,
215
+ rules: item === null || item === void 0 ? void 0 : item.rules
216
+ }, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
217
+ defaultValue: item.defaultValue
218
+ }, item === null || item === void 0 ? void 0 : item.value.map(v => /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
219
+ value: v.value,
220
+ label: v.label
221
+ }))));
222
+ }
223
+ if ((item === null || item === void 0 ? void 0 : item.widget) === "input") {
224
+ var _item$value;
225
+ return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
226
+ name: "".concat(item === null || item === void 0 ? void 0 : item.name).concat(index ? index : ""),
227
+ label: renderLabelWithTooltip(item === null || item === void 0 ? void 0 : item.label, item === null || item === void 0 ? void 0 : item.tooltip),
228
+ rules: getFieldRules(itemData, item),
229
+ extra: item === null || item === void 0 ? void 0 : item.helpText,
230
+ initialValue: item !== null && item !== void 0 && item.value ? item === null || item === void 0 || (_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.toString() : undefined
231
+ }, /*#__PURE__*/_react.default.createElement(_CustomInput.default, _extends({}, item === null || item === void 0 ? void 0 : item.props, {
232
+ placeholder: item === null || item === void 0 ? void 0 : item.placeholder,
233
+ onInput: e => {
234
+ var _item$validateInput;
235
+ return item === null || item === void 0 || (_item$validateInput = item.validateInput) === null || _item$validateInput === void 0 ? void 0 : _item$validateInput.call(item, e, 10);
236
+ },
237
+ prefix: item === null || item === void 0 ? void 0 : item.prefix
238
+ })));
239
+ }
240
+ if ((item === null || item === void 0 ? void 0 : item.widget) === "checkbox") {
241
+ var _item$rules, _item$disabled4, _item$className;
242
+ return /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.BgColorCheckBox, null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
243
+ name: "".concat(item === null || item === void 0 ? void 0 : item.name).concat(index ? index : ""),
244
+ rules: item === null || item === void 0 || (_item$rules = item.rules) === null || _item$rules === void 0 ? void 0 : _item$rules.map(r => (r === null || r === void 0 ? void 0 : r.checkValidator) && (r === null || r === void 0 ? void 0 : r.rule)).filter(Boolean),
245
+ valuePropName: "checked",
246
+ initialValue: item === null || item === void 0 ? void 0 : item.checked
247
+ }, /*#__PURE__*/_react.default.createElement(_CustomCheckBox.default, {
248
+ disabled: (_item$disabled4 = item.disabled) !== null && _item$disabled4 !== void 0 ? _item$disabled4 : false,
249
+ size: "large",
250
+ label: item === null || item === void 0 ? void 0 : item.label,
251
+ className: (_item$className = item === null || item === void 0 ? void 0 : item.className) !== null && _item$className !== void 0 ? _item$className : ""
252
+ })));
253
+ }
254
+ const handleS3Response = (res, fieldName) => {
255
+ var _res$data;
256
+ const docId = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.uuid;
257
+ if (docId != null) {
258
+ form.setFieldsValue({
259
+ [fieldName]: docId
260
+ });
261
+ }
262
+ };
263
+ if (item.widget === "upload") {
264
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
265
+ className: dynamicClassInCaseOfUpload(item)
266
+ }, " ", /*#__PURE__*/_react.default.createElement(_CustomUpload.default, _extends({
267
+ label: (item === null || item === void 0 ? void 0 : item.heading) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
268
+ color: "primary-content",
269
+ typography: item !== null && item !== void 0 && item.headingTypography ? item === null || item === void 0 ? void 0 : item.headingTypography : "type-t2-700"
270
+ }, item === null || item === void 0 ? void 0 : item.heading),
271
+ isS3Upload: true,
272
+ form: form,
273
+ generateS3Url: generateS3Url,
274
+ uploadOnS3: uploadOnS3,
275
+ formName: item === null || item === void 0 ? void 0 : item.name,
276
+ formRules: item === null || item === void 0 ? void 0 : item.rules,
277
+ allowedMediaType: item === null || item === void 0 ? void 0 : item.allowedMediaType,
278
+ maxAllowedSize: item === null || item === void 0 ? void 0 : item.maxAllowedSize,
279
+ downloadCallback: downloadFileOnS3,
280
+ beforeUploadFileValidations: item === null || item === void 0 ? void 0 : item.beforeUploadFileValidations,
281
+ s3ResponseReturn: res => handleS3Response(res, item.name)
282
+ }, item === null || item === void 0 ? void 0 : item.uploadProps))));
283
+ }
284
+ };
285
+ const renderWidget = item => {
286
+ var _item$value2, _item$value3, _item$value3$map, _item$value4, _item$value5, _item$value6, _item$value7, _item$iconConfig, _item$subType, _item$disabled5;
287
+ switch (item === null || item === void 0 ? void 0 : item.type) {
288
+ case "simpleList":
289
+ if ((item === null || item === void 0 || (_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : _item$value2.length) === 0) return null;
290
+ return /*#__PURE__*/_react.default.createElement(_styles.ListofDamageParts, null, /*#__PURE__*/_react.default.createElement("ul", {
291
+ className: "damagedParts"
292
+ }, item === null || item === void 0 || (_item$value3 = item.value) === null || _item$value3 === void 0 || (_item$value3$map = _item$value3.map) === null || _item$value3$map === void 0 ? void 0 : _item$value3$map.call(_item$value3, v => /*#__PURE__*/_react.default.createElement("li", {
293
+ key: v
294
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
295
+ color: "secondary-content",
296
+ typography: "type-b2-400"
297
+ }, v)))));
298
+ case "questionAnsList":
299
+ if ((item === null || item === void 0 || (_item$value4 = item.value) === null || _item$value4 === void 0 ? void 0 : _item$value4.length) === 0) return null;
300
+ return /*#__PURE__*/_react.default.createElement(_styles.IncidentListParts, null, /*#__PURE__*/_react.default.createElement("div", {
301
+ className: "qaSec"
302
+ }, /*#__PURE__*/_react.default.createElement("dl", null, item === null || item === void 0 || (_item$value5 = item.value) === null || _item$value5 === void 0 ? void 0 : _item$value5.map(v => /*#__PURE__*/_react.default.createElement("dt", {
303
+ key: v === null || v === void 0 ? void 0 : v.question
304
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
305
+ color: "premary-content",
306
+ typography: "type-t2-700"
307
+ }, v === null || v === void 0 ? void 0 : v.question), /*#__PURE__*/_react.default.createElement("div", {
308
+ className: "margin-top-4"
309
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
310
+ color: "premary-content",
311
+ typography: "type-b2-400"
312
+ }, v === null || v === void 0 ? void 0 : v.answer)))))));
313
+ case "infoCardWithInput":
314
+ return item === null || item === void 0 || (_item$value6 = item.value) === null || _item$value6 === void 0 ? void 0 : _item$value6.map((value, i) => {
315
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ItemInfoCardWidget.default, _extends({
316
+ key: i
317
+ }, value)), (value === null || value === void 0 ? void 0 : value.field) && renderFieldWidget(value === null || value === void 0 ? void 0 : value.field, i, item));
318
+ });
319
+ case "infoCard":
320
+ return Array.isArray(item === null || item === void 0 ? void 0 : item.value) && (item === null || item === void 0 || (_item$value7 = item.value) === null || _item$value7 === void 0 ? void 0 : _item$value7.map((v, i) => /*#__PURE__*/_react.default.createElement(_ItemInfoCardWidget.default, _extends({
321
+ key: i
322
+ }, v))));
323
+ case "infoCardFooter":
324
+ return /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.TotalRow, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
325
+ typography: "type-t1-500",
326
+ style: {
327
+ color: _ColorVariablesMap.default["--color-positive"]
328
+ }
329
+ }, item === null || item === void 0 ? void 0 : item.text), /*#__PURE__*/_react.default.createElement("div", {
330
+ className: "gstAndCost"
331
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
332
+ typography: "type-t1-500",
333
+ style: {
334
+ color: _ColorVariablesMap.default["--color-positive"]
335
+ }
336
+ }, "\u20B9", item.value), (item === null || item === void 0 ? void 0 : item.subText) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
337
+ className: "margin-top-4",
338
+ typography: "type-button-500",
339
+ color: "secondary-content"
340
+ }, item.subText)));
341
+ case "keyValue":
342
+ const keyValueInfo = item !== null && item !== void 0 && item.info ? {
343
+ infoKey: item.info.infoKey,
344
+ infoData: /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
345
+ title: item.info.tooltipTitle,
346
+ placement: "top"
347
+ }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
348
+ color: item.info.color || "secondary",
349
+ size: item.info.size || 16,
350
+ icon: _InfoOutlined.default
351
+ }))
352
+ } : undefined;
353
+ return /*#__PURE__*/_react.default.createElement(_KeyValueWidget.default, {
354
+ key: item.key,
355
+ data: item.value,
356
+ info: keyValueInfo,
357
+ columnLayout: item === null || item === void 0 ? void 0 : item.columnLayout,
358
+ customClassName: item.className,
359
+ tagStatus: item === null || item === void 0 ? void 0 : item.tagStatus
360
+ });
361
+ case "tag":
362
+ return /*#__PURE__*/_react.default.createElement("div", {
363
+ className: "margin-bottom-32"
364
+ }, /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
365
+ type: item.tagType,
366
+ label: item.label
367
+ }));
368
+ case "customInfo":
369
+ return /*#__PURE__*/_react.default.createElement("div", {
370
+ className: "margin-bottom-24"
371
+ }, " ", /*#__PURE__*/_react.default.createElement(_CustomInfo.default, _extends({
372
+ description: item === null || item === void 0 ? void 0 : item.value,
373
+ color: item === null || item === void 0 ? void 0 : item.bgcolor
374
+ }, (item === null || item === void 0 ? void 0 : item.iconConfig) && {
375
+ iconConfig: {
376
+ icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
377
+ color: item === null || item === void 0 || (_item$iconConfig = item.iconConfig) === null || _item$iconConfig === void 0 ? void 0 : _item$iconConfig.color,
378
+ size: 24,
379
+ icon: item.iconConfig.icon
380
+ }),
381
+ position: item.iconConfig.position
382
+ }
383
+ })));
384
+ case "button":
385
+ return /*#__PURE__*/_react.default.createElement("div", {
386
+ className: "margin-bottom-16"
387
+ }, /*#__PURE__*/_react.default.createElement(_CustomButton.default, _extends({
388
+ type: (_item$subType = item === null || item === void 0 ? void 0 : item.subType) !== null && _item$subType !== void 0 ? _item$subType : "primary",
389
+ label: item === null || item === void 0 ? void 0 : item.label,
390
+ disabled: (_item$disabled5 = item === null || item === void 0 ? void 0 : item.disabled) !== null && _item$disabled5 !== void 0 ? _item$disabled5 : false,
391
+ onClick: () => {
392
+ if (item !== null && item !== void 0 && item.onClick) {
393
+ item.onClick(item === null || item === void 0 ? void 0 : item.action, item === null || item === void 0 ? void 0 : item.key);
394
+ }
395
+ }
396
+ }, item === null || item === void 0 ? void 0 : item.props)));
397
+ case "collapsibleKeyValue":
398
+ return /*#__PURE__*/_react.default.createElement("div", {
399
+ className: "margin-bottom-16"
400
+ }, /*#__PURE__*/_react.default.createElement(_CollapsibleKeyValueWidget.default, {
401
+ items: (item === null || item === void 0 ? void 0 : item.items) || [],
402
+ title: item === null || item === void 0 ? void 0 : item.title,
403
+ expandButtonText: item === null || item === void 0 ? void 0 : item.expandButtonText,
404
+ collapseButtonText: item === null || item === void 0 ? void 0 : item.collapseButtonText,
405
+ expandButtonType: item === null || item === void 0 ? void 0 : item.expandButtonType,
406
+ collapseButtonType: item === null || item === void 0 ? void 0 : item.collapseButtonType,
407
+ expandButtonSize: item === null || item === void 0 ? void 0 : item.expandButtonSize,
408
+ collapseButtonSize: item === null || item === void 0 ? void 0 : item.collapseButtonSize,
409
+ onItemToggle: item === null || item === void 0 ? void 0 : item.onItemToggle,
410
+ onFetchMoreInfo: item === null || item === void 0 ? void 0 : item.onFetchMoreInfo,
411
+ handleCollapsibleKeyData: handleCollapsibleKeyData
412
+ }));
413
+ case "userManagement":
414
+ return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
415
+ name: (item === null || item === void 0 ? void 0 : item.name) || "users",
416
+ label: item === null || item === void 0 ? void 0 : item.label,
417
+ initialValue: (item === null || item === void 0 ? void 0 : item.value) || []
418
+ }, /*#__PURE__*/_react.default.createElement(_UserManagementWidget.default, _extends({
419
+ form: form,
420
+ fieldName: (item === null || item === void 0 ? void 0 : item.name) || "users",
421
+ initialData: (item === null || item === void 0 ? void 0 : item.value) || [],
422
+ fields: item === null || item === void 0 ? void 0 : item.fields,
423
+ disabled: (item === null || item === void 0 ? void 0 : item.disabled) || false,
424
+ customPageModal: props === null || props === void 0 ? void 0 : props.customPageModal
425
+ }, props)));
426
+ case "field":
427
+ return renderFieldWidget(item);
428
+ default:
429
+ null;
430
+ }
431
+ };
432
+ const Heading = (heading, headingInfo) => /*#__PURE__*/_react.default.createElement("div", {
433
+ className: "margin-bottom-12",
434
+ style: {
435
+ display: "flex",
436
+ alignItems: "center",
437
+ gap: "8px"
438
+ }
439
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
440
+ typography: "type-sl1-700",
441
+ color: "secondary-content"
442
+ }, heading), headingInfo && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
443
+ title: headingInfo,
444
+ placement: "top"
445
+ }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
446
+ icon: _InfoOutlined.default
447
+ })));
448
+ return /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.FormWidgetStyleStyle, null, /*#__PURE__*/_react.default.createElement(_antd.Form, {
449
+ form: form,
450
+ layout: "vertical"
451
+ }, groups === null || groups === void 0 ? void 0 : groups.map((group, index) => {
452
+ if (typeof group !== "object" || group === null || !Array.isArray(group.items)) {
453
+ return null; // Skip invalid group
454
+ }
455
+ const {
456
+ bordered,
457
+ heading,
458
+ headingInfo,
459
+ items,
460
+ topDividerRequired,
461
+ columnLayout
462
+ } = group;
463
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
464
+ key: index
465
+ }, bordered ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, topDividerRequired === true && /*#__PURE__*/_react.default.createElement(_antd.Divider, {
466
+ className: "dividerLine"
467
+ }), Heading(heading, headingInfo), /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.FieldBoxBorder, null, items.map((item, i) => /*#__PURE__*/_react.default.createElement("div", {
468
+ key: i
469
+ }, renderWidget(item))))) : /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.FieldWithoutBorder, null, topDividerRequired !== false && /*#__PURE__*/_react.default.createElement(_antd.Divider, {
470
+ className: "dividerLine"
471
+ }), Heading(heading, headingInfo), /*#__PURE__*/_react.default.createElement("div", {
472
+ style: columnLayout ? _objectSpread({}, columnLayout) : {}
473
+ }, items.map((item, i) => {
474
+ var _item$columnLayoutTem, _item$columnLayoutTem2;
475
+ return /*#__PURE__*/_react.default.createElement("div", {
476
+ key: i,
477
+ style: item !== null && item !== void 0 && item.columnLayoutTemp ? {
478
+ gridArea: (item === null || item === void 0 || (_item$columnLayoutTem = item.columnLayoutTemp) === null || _item$columnLayoutTem === void 0 ? void 0 : _item$columnLayoutTem.gridTemplateArea) || (item === null || item === void 0 || (_item$columnLayoutTem2 = item.columnLayoutTemp) === null || _item$columnLayoutTem2 === void 0 ? void 0 : _item$columnLayoutTem2.gridTempAreaName)
479
+ } : {}
480
+ }, renderWidget(item));
481
+ }))));
482
+ }), /*#__PURE__*/_react.default.createElement(_FormWidgetStyle.FormWidgetStyle, null, visible && /*#__PURE__*/_react.default.createElement("div", {
483
+ className: "formBottomAction"
484
+ }, cancel && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
485
+ type: (_cancel$type = cancel === null || cancel === void 0 ? void 0 : cancel.type) !== null && _cancel$type !== void 0 ? _cancel$type : "danger-secondary",
486
+ size: (_cancel$size = cancel === null || cancel === void 0 ? void 0 : cancel.size) !== null && _cancel$size !== void 0 ? _cancel$size : "medium",
487
+ label: cancel === null || cancel === void 0 ? void 0 : cancel.text,
488
+ onClick: () => {
489
+ var _form$validateFields;
490
+ if ((cancel === null || cancel === void 0 ? void 0 : cancel.buttonClickType) === "openNestedDrawer") {
491
+ handleDrawerFormOnFinish({
492
+ type: cancel === null || cancel === void 0 ? void 0 : cancel.buttonClickType,
493
+ call: cancel === null || cancel === void 0 ? void 0 : cancel.call,
494
+ action: cancel === null || cancel === void 0 ? void 0 : cancel.action
495
+ });
496
+ return;
497
+ }
498
+ form === null || form === void 0 || (_form$validateFields = form.validateFields()) === null || _form$validateFields === void 0 || _form$validateFields.then(value => {
499
+ handleDrawerFormOnFinish(_objectSpread(_objectSpread({}, value), {}, {
500
+ type: cancel === null || cancel === void 0 ? void 0 : cancel.buttonClickType
501
+ }));
502
+ }).catch(errorInfo => {
503
+ // errorInfo contains form validation errors
504
+ // Optionally log or handle validation errors here
505
+ console.log("Validation Failed:", errorInfo);
506
+ });
507
+ }
508
+ })), clear && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
509
+ type: (_clear$type = clear === null || clear === void 0 ? void 0 : clear.type) !== null && _clear$type !== void 0 ? _clear$type : "text-only",
510
+ size: (_clear$size = clear === null || clear === void 0 ? void 0 : clear.size) !== null && _clear$size !== void 0 ? _clear$size : "medium",
511
+ label: clear === null || clear === void 0 ? void 0 : clear.text,
512
+ onClick: () => {
513
+ var _form$validateFields2;
514
+ form === null || form === void 0 || (_form$validateFields2 = form.validateFields()) === null || _form$validateFields2 === void 0 || _form$validateFields2.then(value => {
515
+ handleDrawerFormOnFinish(_objectSpread(_objectSpread({}, value), {}, {
516
+ type: clear === null || clear === void 0 ? void 0 : clear.buttonClickType
517
+ }));
518
+ }).catch(errorInfo => {
519
+ // errorInfo contains form validation errors
520
+ // Optionally log or handle validation errors here
521
+ console.log("Validation Failed:", errorInfo);
522
+ });
523
+ }
524
+ })), submit && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
525
+ type: (_submit$type = submit === null || submit === void 0 ? void 0 : submit.type) !== null && _submit$type !== void 0 ? _submit$type : "primary",
526
+ disabled: (_submit$disabled = submit.disabled) !== null && _submit$disabled !== void 0 ? _submit$disabled : false,
527
+ onClick: () => {
528
+ var _form$validateFields3;
529
+ form === null || form === void 0 || (_form$validateFields3 = form.validateFields()) === null || _form$validateFields3 === void 0 || _form$validateFields3.then(value => {
530
+ var _submit$drawerKey, _submit$fileName;
531
+ handleDrawerFormOnFinish(_objectSpread(_objectSpread({}, value), {}, {
532
+ type: submit === null || submit === void 0 ? void 0 : submit.buttonClickType,
533
+ drawerKey: (_submit$drawerKey = submit === null || submit === void 0 ? void 0 : submit.drawerKey) !== null && _submit$drawerKey !== void 0 ? _submit$drawerKey : undefined,
534
+ fileName: (_submit$fileName = submit === null || submit === void 0 ? void 0 : submit.fileName) !== null && _submit$fileName !== void 0 ? _submit$fileName : undefined
535
+ }));
536
+ }).catch(errorInfo => {
537
+ // errorInfo contains form validation errors
538
+ // Optionally log or handle validation errors here
539
+ console.log("Validation Failed:", errorInfo);
540
+ });
541
+ },
542
+ label: submit === null || submit === void 0 ? void 0 : submit.text
543
+ }))))));
544
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.TotalRow = exports.TooltipLabel = exports.FormWidgetStyleStyle = exports.FormWidgetStyle = exports.FieldWithoutBorder = exports.FieldBoxBorder = exports.BgColorCheckBox = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
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 FormWidgetStyle = exports.FormWidgetStyle = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .formBottomAction {\n position: absolute;\n bottom: 0px;\n background-color: rgb(249, 249, 249);\n box-shadow: rgba(0, 0, 0, 0.1) 0px -2px 8px;\n padding: 16px;\n display: flex;\n justify-content: flex-end;\n gap: 12px;\n z-index: 10;\n left: 0;\n right: 0;\n }\n\n .formBottomAction .ant-form-item {\n margin-bottom: 0px;\n }\n"])));
12
+ const FormWidgetStyleStyle = exports.FormWidgetStyleStyle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-form-vertical\n .ant-form-item:not(.ant-form-item-horizontal)\n .ant-form-item-label {\n padding: 0 0 4px 0;\n }\n .ant-form-item-margin-offset {\n margin-bottom: 0px !important;\n }\n"])));
13
+ const FieldBoxBorder = exports.FieldBoxBorder = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: 12px;\n border: 1px solid #e0e0e0;\n padding: 16px;\n"])));
14
+ const FieldWithoutBorder = exports.FieldWithoutBorder = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .cstUplaodWithText {\n display: flex;\n width: 100%;\n flex-direction: row;\n justify-content: space-between;\n margin-bottom: 24px;\n }\n\n .cstUplaodWithText .uploadDiv,\n .cstUplaodWithText > div,\n .cstUplaodWithText > div > section {\n width: 100%;\n }\n\n .cstUplaodWithText .ant-form-item-row {\n justify-content: space-between;\n flex-direction: row;\n flex-flow: row !important;\n width: 100%;\n }\n\n .cstUplaodWithText .ant-form-item-control {\n flex-grow: 0;\n width: auto !important;\n }\n\n .cstUplaodWithTextTop {\n display: flex;\n width: 100%;\n flex-direction: column;\n justify-content: space-between;\n margin-bottom: 24px;\n gap: 4px;\n }\n"])));
15
+ const TotalRow = exports.TotalRow = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n border-top: 1px solid #e0e0e0;\n padding: 16px 16px 0 16px;\n margin: 0 0 0 -16px;\n width: calc(100% + 32px);\n\n.gstAndCost{display: flex;\n flex-direction: column;\n align-items: flex-end;\n justify-content: center;}\n\n\n\n\n"])));
16
+ const BgColorCheckBox = exports.BgColorCheckBox = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\n.bottomLabelCheckboxNotFix {\n padding: 16px;\n background: #DEF1FB;\n border-radius: 4px;\n}\n"])));
17
+ const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 8px;\n\n .tooltip-icon {\n transition: opacity 0.2s ease;\n\n &:hover {\n opacity: 0.8;\n }\n }\n"])));
18
+ var _default = exports.default = {};