oa-componentbook 1.0.1-stage.37 → 1.0.1-stage.371

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 (126) hide show
  1. package/build/components/oa-component-accordion/Accordion.js +102 -42
  2. package/build/components/oa-component-accordion/styles.js +2 -2
  3. package/build/components/oa-component-button/CustomButton.js +6 -4
  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 +25 -22
  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-modal/styles.js +3 -2
  11. package/build/components/oa-component-pagination/CustomPagination.js +111 -0
  12. package/build/components/oa-component-pagination/styles.js +12 -0
  13. package/build/components/oa-component-select/CustomSelect.js +116 -56
  14. package/build/components/oa-component-steps/CustomSteps.js +117 -0
  15. package/build/components/oa-component-steps/styles.js +12 -0
  16. package/build/components/oa-component-table/CustomTable.js +28 -5
  17. package/build/components/oa-component-table/CustomTableV1.js +521 -0
  18. package/build/components/oa-component-table/styles.js +1 -1
  19. package/build/components/oa-component-table/stylesV1.js +19 -0
  20. package/build/components/oa-component-tabs/CustomTabs.js +1 -1
  21. package/build/components/oa-component-tag/CustomTag.js +29 -11
  22. package/build/components/oa-component-tag/styles.js +30 -3
  23. package/build/components/oa-component-textarea/{TextArea.js → CustomTextArea.js} +4 -4
  24. package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
  25. package/build/components/oa-component-upload/CustomUpload.js +120 -40
  26. package/build/components/oa-component-viewer/CustomViewer.js +3 -1
  27. package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
  28. package/build/dev/oa-component-document-viewer/styles.js +12 -0
  29. package/build/dev/oa-component-upload/CustomUpload.js +3 -0
  30. package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
  31. package/build/dev/oa-widget-document-modal/styles.js +12 -0
  32. package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
  33. package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
  34. package/build/global-css/GlobalCss.js +2 -1
  35. package/build/global-css/GridLayout.js +1 -1
  36. package/build/global-css/commonStyles.js +11 -0
  37. package/build/images/Car.png +0 -0
  38. package/build/images/TwoWheeler.png +0 -0
  39. package/build/images/astronaut_emptystate.png +0 -0
  40. package/build/images/exportGrp01.png +0 -0
  41. package/build/images/exportGrp02.png +0 -0
  42. package/build/images/exportGrp03.png +0 -0
  43. package/build/images/outOfStock.png +0 -0
  44. package/build/index.js +114 -2
  45. package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
  46. package/build/layout/DetailDataLayout/components/Form.js +22 -0
  47. package/build/layout/DetailDataLayout/components/Header.js +32 -0
  48. package/build/layout/DetailDataLayout/style.css +9 -0
  49. package/build/layout/DetailDataLayout/styles.js +12 -0
  50. package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +212 -0
  51. package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +77 -0
  52. package/build/layout/EntityOverviewLayout/styles.js +13 -0
  53. package/build/layout/GenricLayOut/GenricLayOut.js +2287 -0
  54. package/build/layout/GenricLayOut/components/AppliedFilters.js +84 -0
  55. package/build/layout/GenricLayOut/components/CardList.js +34 -0
  56. package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
  57. package/build/layout/GenricLayOut/components/Header.js +74 -0
  58. package/build/layout/GenricLayOut/components/Modal.js +85 -0
  59. package/build/layout/GenricLayOut/components/ProfileSection.js +87 -0
  60. package/build/layout/GenricLayOut/components/Search.js +51 -0
  61. package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
  62. package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
  63. package/build/layout/GenricLayOut/reducer/layoutReducer.js +294 -0
  64. package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
  65. package/build/layout/GenricLayOut/styles.js +25 -0
  66. package/build/utils/download-file.js +23 -0
  67. package/build/widgets/oa-form-widget/FormWidget.js +544 -0
  68. package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
  69. package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +73 -12
  70. package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
  71. package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
  72. package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +481 -0
  73. package/build/widgets/oa-widget-approval/styles.js +2 -2
  74. package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
  75. package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
  76. package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +395 -0
  77. package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
  78. package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
  79. package/build/widgets/oa-widget-content-panel/styles.js +12 -0
  80. package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
  81. package/build/widgets/oa-widget-detailcard/styles.js +1 -1
  82. package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
  83. package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
  84. package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
  85. package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
  86. package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
  87. package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
  88. package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
  89. package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
  90. package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +256 -0
  91. package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
  92. package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
  93. package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
  94. package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
  95. package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
  96. package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
  97. package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
  98. package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +77 -0
  99. package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
  100. package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
  101. package/build/widgets/oa-widget-key-value/KeyValueWidget.js +40 -10
  102. package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
  103. package/build/widgets/oa-widget-kpi/styles.js +12 -0
  104. package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
  105. package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
  106. package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
  107. package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
  108. package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
  109. package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
  110. package/build/widgets/oa-widget-notes/NotesWidget.js +2 -1
  111. package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -0
  112. package/build/widgets/oa-widget-profile-data/styles.js +13 -0
  113. package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
  114. package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
  115. package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
  116. package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
  117. package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
  118. package/build/widgets/oa-widget-sidebar/SidebarWidget.js +87 -0
  119. package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
  120. package/build/widgets/oa-widget-sidebar/sidebar.css +0 -0
  121. package/build/widgets/oa-widget-sidebar/styles.js +12 -0
  122. package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +57 -29
  123. package/build/widgets/oa-widget-track-shipment-list/fn.js +16 -4
  124. package/build/widgets/oa-widget-user-management/UserManagementWidget.js +332 -0
  125. package/build/widgets/oa-widget-user-management/styles.js +15 -0
  126. package/package.json +4 -2
@@ -11,7 +11,10 @@ require("core-js/modules/es.array.includes.js");
11
11
  require("core-js/modules/es.string.includes.js");
12
12
  require("core-js/modules/es.regexp.exec.js");
13
13
  require("core-js/modules/es.regexp.test.js");
14
+ require("core-js/modules/es.parse-int.js");
15
+ require("core-js/modules/es.string.trim.js");
14
16
  require("core-js/modules/es.array.reduce.js");
17
+ require("core-js/modules/es.parse-float.js");
15
18
  var _react = _interopRequireWildcard(require("react"));
16
19
  var _propTypes = _interopRequireDefault(require("prop-types"));
17
20
  var _antd = require("antd");
@@ -82,7 +85,8 @@ function AddSparePartCollapseWidget(_ref) {
82
85
  setActiveKey(Array.from(initialSelectedItems).map(String)); // Set initially selected items as active keys
83
86
  }, [selectedItems]);
84
87
  (0, _react.useEffect)(() => {
85
- const sortedItems = [...selectedItems.map(item => items && items.find(i => i.id === item.scopeId)).filter(Boolean), ...items.filter(item => !selectedItems.some(selected => selected.scopeId === item.id))];
88
+ var _selectedItems$map$fi, _items$filter;
89
+ const sortedItems = [...((_selectedItems$map$fi = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => items && items.find(i => i.id === item.scopeId)).filter(Boolean)) !== null && _selectedItems$map$fi !== void 0 ? _selectedItems$map$fi : []), ...((_items$filter = items === null || items === void 0 ? void 0 : items.filter(item => !selectedItems.some(selected => selected.scopeId === item.id))) !== null && _items$filter !== void 0 ? _items$filter : [])];
86
90
  setFilteredItems(sortedItems);
87
91
  }, [items, selectedItems]);
88
92
 
@@ -141,7 +145,22 @@ function AddSparePartCollapseWidget(_ref) {
141
145
  }
142
146
  }, 0);
143
147
  };
144
- const isNumeric = value => /^\d*$/.test(value); // Regular expression to check if the value is numeric
148
+
149
+ /**
150
+ * Checks if a given value is numeric.
151
+ *
152
+ * This function verifies if the provided value is a numeric string,
153
+ * optionally allowing two decimal places. An empty string is also
154
+ * considered valid, allowing for clearing inputs.
155
+ *
156
+ * @param {string} value - The value to check.
157
+ * @returns {boolean} - Returns true if the value is numeric or empty, otherwise false.
158
+ */
159
+
160
+ const isNumeric = value => {
161
+ if (value === '') return true;
162
+ return /^\d+(\.\d{0,2})?$/.test(value);
163
+ };
145
164
 
146
165
  /**
147
166
  * Handles changes in the fields of the items.
@@ -154,8 +173,18 @@ function AddSparePartCollapseWidget(_ref) {
154
173
  * @param {string|number} value - The new value of the field.
155
174
  */
156
175
  const onFieldChange = (itemId, field, value) => {
157
- if (field === 'hsnId' || isNumeric(value)) {
158
- // Bypass numeric check for HSN Code
176
+ if (field === 'hsnId' || (field === 'discount' || field === 'cost') && isNumeric(value)) {
177
+ if (field === 'discount') {
178
+ var _formValues$itemId;
179
+ if (parseInt((_formValues$itemId = formValues[itemId]) === null || _formValues$itemId === void 0 ? void 0 : _formValues$itemId.cost, 10) < parseInt(value, 10)) {
180
+ openNotification({
181
+ title: 'Error',
182
+ description: 'Discount cannot be greater than Cost.',
183
+ type: 'failure'
184
+ });
185
+ return;
186
+ }
187
+ }
159
188
  const updatedFormValues = _objectSpread(_objectSpread({}, formValues), {}, {
160
189
  [itemId]: _objectSpread(_objectSpread({}, formValues[itemId]), {}, {
161
190
  [field]: value
@@ -163,11 +192,11 @@ function AddSparePartCollapseWidget(_ref) {
163
192
  });
164
193
  setFormValues(updatedFormValues);
165
194
  } else {
166
- openNotification({
167
- title: 'Error',
168
- description: 'Please enter only numeric values.',
169
- type: 'failure'
170
- });
195
+ // openNotification({
196
+ // title: 'Error',
197
+ // description: 'Please enter only numeric values 146.',
198
+ // type: 'failure',
199
+ // });
171
200
  }
172
201
  };
173
202
 
@@ -179,7 +208,7 @@ function AddSparePartCollapseWidget(_ref) {
179
208
  * @param {React.KeyboardEvent} event - The event triggered by the key press.
180
209
  */
181
210
  const handleKeyPress = event => {
182
- if (!/[0-9]/.test(event.key)) {
211
+ if (!/[\d.]/.test(event.key) || event.key === '.' && event.target.value.includes('.')) {
183
212
  event.preventDefault();
184
213
  openNotification({
185
214
  title: 'Error',
@@ -188,6 +217,21 @@ function AddSparePartCollapseWidget(_ref) {
188
217
  });
189
218
  }
190
219
  };
220
+ const handlePaste = e => {
221
+ var _e$clipboardData$getD, _e$clipboardData;
222
+ const pastedData = (_e$clipboardData$getD = e === null || e === void 0 || (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 || (_e$clipboardData = _e$clipboardData.getData('Text')) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.trim()) !== null && _e$clipboardData$getD !== void 0 ? _e$clipboardData$getD : '';
223
+
224
+ // Allow only numbers with optional decimal part (up to 2 digits after .)
225
+ const validDecimalPattern = /^\d+(\.\d{0,2})?$/;
226
+ if (!validDecimalPattern.test(pastedData)) {
227
+ e.preventDefault();
228
+ openNotification({
229
+ title: 'Invalid Paste',
230
+ description: 'Only numeric values with up to 2 decimal places are allowed.',
231
+ type: 'failure'
232
+ });
233
+ }
234
+ };
191
235
 
192
236
  /**
193
237
  * Handles the submission of the spare parts information.
@@ -228,7 +272,22 @@ function AddSparePartCollapseWidget(_ref) {
228
272
  });
229
273
  return;
230
274
  }
231
- onSubmit(toSubmit); // Call the passed onSubmit function with the data to submit
275
+ toSubmit.every(item => {
276
+ const cost = parseFloat(item.cost);
277
+ const discount = parseFloat(item.discount);
278
+ const field = items.find(f => f.id === item.scopeId);
279
+ const fieldName = field ? field.name : "ScopeId ".concat(item.scopeId);
280
+ if (discount > cost) {
281
+ openNotification({
282
+ title: 'Error',
283
+ description: "Discount cannot be greater than cost for ".concat(fieldName),
284
+ type: 'failure'
285
+ });
286
+ return false;
287
+ }
288
+ return true;
289
+ });
290
+ onSubmit(toSubmit);
232
291
  };
233
292
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
234
293
  buttonConfig: [{
@@ -313,8 +372,9 @@ function AddSparePartCollapseWidget(_ref) {
313
372
  placeholder: "Enter price without GST",
314
373
  onChange: e => onFieldChange(item.id, 'cost', e.target.value),
315
374
  onKeyPress: handleKeyPress,
375
+ onPaste: handlePaste,
316
376
  inputMode: "numeric",
317
- pattern: "[0-9]*",
377
+ pattern: "[0-9]+(\\.[0-9]{0,2})?",
318
378
  value: ((_formValues$item$id = formValues[item.id]) === null || _formValues$item$id === void 0 ? void 0 : _formValues$item$id.cost) !== null && ((_formValues$item$id2 = formValues[item.id]) === null || _formValues$item$id2 === void 0 ? void 0 : _formValues$item$id2.cost) !== undefined ? (_formValues$item$id3 = formValues[item.id]) === null || _formValues$item$id3 === void 0 ? void 0 : _formValues$item$id3.cost : '',
319
379
  disabled: isItemDisabled
320
380
  })), !disableDiscount && /*#__PURE__*/_react.default.createElement("div", {
@@ -337,6 +397,7 @@ function AddSparePartCollapseWidget(_ref) {
337
397
  placeholder: "Enter discount",
338
398
  onChange: e => onFieldChange(item.id, 'discount', e.target.value),
339
399
  onKeyPress: handleKeyPress,
400
+ onPaste: handlePaste,
340
401
  inputMode: "numeric",
341
402
  pattern: "[0-9]*",
342
403
  value: ((_formValues$item$id4 = formValues[item.id]) === null || _formValues$item$id4 === void 0 ? void 0 : _formValues$item$id4.discount) !== null && ((_formValues$item$id5 = formValues[item.id]) === null || _formValues$item$id5 === void 0 ? void 0 : _formValues$item$id5.discount) !== undefined ? (_formValues$item$id6 = formValues[item.id]) === null || _formValues$item$id6 === void 0 ? void 0 : _formValues$item$id6.discount : '',
@@ -10,6 +10,9 @@ exports.default = void 0;
10
10
  require("core-js/modules/web.dom-collections.iterator.js");
11
11
  require("core-js/modules/es.array.includes.js");
12
12
  require("core-js/modules/es.string.includes.js");
13
+ require("core-js/modules/es.regexp.exec.js");
14
+ require("core-js/modules/es.regexp.test.js");
15
+ require("core-js/modules/es.promise.js");
13
16
  var _react = _interopRequireWildcard(require("react"));
14
17
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
18
  var _antd = require("antd");
@@ -165,23 +168,63 @@ function AddSparePartWidget(_ref) {
165
168
  // This field is enabled only if the corresponding part is selected
166
169
  ,
167
170
  disabled: !selectedParts.includes(spare.scopeId),
168
- prefix: "\u20B9"
171
+ prefix: "\u20B9",
172
+ onPaste: e => {
173
+ var _e$clipboardData$getD, _e$clipboardData;
174
+ const pasted = (_e$clipboardData$getD = e === null || e === void 0 || (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.getData('Text')) !== null && _e$clipboardData$getD !== void 0 ? _e$clipboardData$getD : '';
175
+ const validDecimalPattern = /^\d+(\.\d*)?$/;
176
+ if (!validDecimalPattern.test(pasted)) {
177
+ e.preventDefault(); // Block invalid paste
178
+ }
179
+ }
169
180
  })),
170
181
  discount: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
171
182
  name: "discount-".concat(spare.scopeId),
172
183
  rules: [{
173
- // This field is required only if the corresponding part is selected
174
184
  required: selectedParts.includes(spare.scopeId),
175
185
  message: 'Required field'
176
- // message: 'Enter the discount value.',
186
+ }, {
187
+ validator: (_, value) => {
188
+ const maxDiscount = form.getFieldValue("cost-".concat(spare.scopeId)) || 0;
189
+ if (value > maxDiscount) {
190
+ return Promise.reject(new Error('Discount cannot exceed the Part Price!'));
191
+ }
192
+ return Promise.resolve();
193
+ }
177
194
  }],
178
195
  initialValue: ""
179
196
  }, /*#__PURE__*/_react.default.createElement(_CustomInputNumber.default, {
180
- size: "small"
181
- // This field is enabled only if the corresponding part is selected
182
- ,
197
+ size: "small",
183
198
  disabled: !selectedParts.includes(spare.scopeId),
184
- prefix: "\u20B9"
199
+ prefix: "\u20B9",
200
+ max: form.getFieldValue("cost-".concat(spare.scopeId)),
201
+ value: form.getFieldValue("discount-".concat(spare.scopeId)),
202
+ onPaste: e => {
203
+ var _e$clipboardData$getD2, _e$clipboardData2;
204
+ const pasted = (_e$clipboardData$getD2 = (_e$clipboardData2 = e.clipboardData) === null || _e$clipboardData2 === void 0 ? void 0 : _e$clipboardData2.getData('Text')) !== null && _e$clipboardData$getD2 !== void 0 ? _e$clipboardData$getD2 : '';
205
+ const validDecimalPattern = /^\d+(\.\d*)?$/;
206
+ if (!validDecimalPattern.test(pasted)) {
207
+ e.preventDefault(); // Block invalid paste
208
+ }
209
+ },
210
+ onChange: value => {
211
+ const maxDiscount = form.getFieldValue("discount-".concat(spare.scopeId)) || 0;
212
+ if (value > maxDiscount) {
213
+ form.setFieldValue("discount-".concat(spare.scopeId), maxDiscount);
214
+ } else {
215
+ form.setFieldValue("discount-".concat(spare.scopeId), value);
216
+ }
217
+ form.validateFields(["discount-".concat(spare.scopeId)]);
218
+ },
219
+ onBlur: () => {
220
+ // Ensure field is corrected after losing focus
221
+ const value = form.getFieldValue("discount-".concat(spare.scopeId));
222
+ const maxDiscount = form.getFieldValue("cost-".concat(spare.scopeId));
223
+ if (value > maxDiscount) {
224
+ form.setFieldValue("discount-".concat(spare.scopeId), maxDiscount);
225
+ form.validateFields(["discount-".concat(spare.scopeId)]);
226
+ }
227
+ }
185
228
  })),
186
229
  hsnId: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
187
230
  name: "hsnId-".concat(spare.scopeId),
@@ -15,31 +15,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
  * @param {object} address - The address object containing address details.
16
16
  */
17
17
  function AddressWidget(_ref) {
18
- var _address$additional_i, _address$additional_i2;
19
18
  let {
20
19
  address
21
20
  } = _ref;
22
- return /*#__PURE__*/_react.default.createElement(_styles.AddressContainer, null, address.heading && /*#__PURE__*/_react.default.createElement(_Typography.default, {
21
+ const {
22
+ heading,
23
+ addressLine1,
24
+ addressLine2,
25
+ landmark,
26
+ city,
27
+ pincode
28
+ } = address !== null && address !== void 0 ? address : {};
29
+ return /*#__PURE__*/_react.default.createElement(_styles.AddressContainer, null, heading && /*#__PURE__*/_react.default.createElement(_Typography.default, {
23
30
  typography: "type-b2-400"
24
- }, address.heading), /*#__PURE__*/_react.default.createElement(_styles.AddressLines, null, address.addressLine1 && /*#__PURE__*/_react.default.createElement(_Typography.default, {
31
+ }, heading), /*#__PURE__*/_react.default.createElement(_styles.AddressLines, null, addressLine1 && /*#__PURE__*/_react.default.createElement(_Typography.default, {
25
32
  color: "secondary-content",
26
33
  typography: "type-b2-400"
27
- }, address.addressLine1), address.addressLine2 && /*#__PURE__*/_react.default.createElement(_Typography.default, {
34
+ }, address.addressLine1, ","), /*#__PURE__*/_react.default.createElement(_Typography.default, {
28
35
  color: "secondary-content",
29
36
  typography: "type-b2-400"
30
- }, address.addressLine2), address.addressLine3 && /*#__PURE__*/_react.default.createElement(_Typography.default, {
31
- color: "secondary-content",
32
- typography: "type-b2-400"
33
- }, address.addressLine3), address.landmark && /*#__PURE__*/_react.default.createElement("i", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
34
- color: "secondary-content",
35
- typography: "type-b2-400"
36
- }, "Near", ' ', address.landmark)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
37
- color: "secondary-content",
38
- typography: "type-b2-400"
39
- }, address.city, ', ', address.state, address.pincode), (address === null || address === void 0 || (_address$additional_i = address.additional_info) === null || _address$additional_i === void 0 ? void 0 : _address$additional_i.lat) && (address === null || address === void 0 || (_address$additional_i2 = address.additional_info) === null || _address$additional_i2 === void 0 ? void 0 : _address$additional_i2.long) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
40
- color: "secondary-content",
41
- typography: "type-b2-400"
42
- }, "Location:", ' ', address.additional_info.lat, ",", address.additional_info.long)));
37
+ }, addressLine2 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, addressLine2, ",", ' ') : null, landmark ? "".concat(landmark, ", ") : null, city ? "".concat(city, ", ") : null, pincode || null)));
43
38
  }
44
39
  AddressWidget.propTypes = {
45
40
  address: _propTypes.default.shape({