@wavemaker/react-runtime 11.14.2-1.245 → 11.15.0-rc.245

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 (245) hide show
  1. package/actions/base-action.js +5 -7
  2. package/actions/login-action.js +7 -8
  3. package/actions/logout-action.js +5 -7
  4. package/actions/navigation-action.js +73 -18
  5. package/actions/notification-action.js +22 -8
  6. package/actions/timer-action.js +13 -15
  7. package/actions/toast.js +4 -2
  8. package/actions/toast.service.js +1 -2
  9. package/components/advanced/carousel/index.js +1 -1
  10. package/components/advanced/carousel/template.js +1 -1
  11. package/components/basic/anchor/index.js +31 -11
  12. package/components/basic/html/index.js +115 -24
  13. package/components/basic/icon/index.js +2 -1
  14. package/components/basic/iframe/index.js +2 -1
  15. package/components/basic/label/index.js +12 -9
  16. package/components/basic/message/index.js +12 -3
  17. package/components/basic/picture/index.js +11 -4
  18. package/components/basic/progress-bar/index.js +4 -1
  19. package/components/basic/progress-circle/index.js +34 -28
  20. package/components/basic/progress-circle/props.js +10 -2
  21. package/components/basic/richtexteditor/index.js +95 -94
  22. package/components/basic/search/index.js +401 -156
  23. package/components/basic/search/providers.js +126 -61
  24. package/components/basic/spinner/index.js +2 -1
  25. package/components/basic/tree/index.js +34 -34
  26. package/components/basic/tree/utils.js +10 -4
  27. package/components/chart/components/barColumnChart/index.js +36 -33
  28. package/components/chart/components/bubbleChart/index.js +35 -25
  29. package/components/chart/components/chartLegend/utils.js +2 -1
  30. package/components/chart/components/cumulativeLineChart/index.js +30 -26
  31. package/components/chart/components/lineAreaChart/index.js +50 -32
  32. package/components/chart/components/pieDonutChart/index.js +13 -4
  33. package/components/chart/hooks/useXAxisConfig.js +15 -8
  34. package/components/chart/index.js +223 -53
  35. package/components/chart/utils.js +12 -1
  36. package/components/constants.js +5 -2
  37. package/components/container/accordion/accordion-pane/index.js +17 -12
  38. package/components/container/accordion/index.js +9 -4
  39. package/components/container/alignment-utils.js +56 -1
  40. package/components/container/index.js +49 -20
  41. package/components/container/panel/components/panel-header/index.js +3 -4
  42. package/components/container/panel/index.js +15 -10
  43. package/components/container/repeat-template/index.js +33 -0
  44. package/components/container/tabs/index.js +83 -14
  45. package/components/container/tabs/tab-pane/index.js +33 -10
  46. package/components/container/tabs/utils.js +51 -0
  47. package/components/container/wizard/components/StepComponents.js +2 -1
  48. package/components/container/wizard/components/WizardStep.js +2 -1
  49. package/components/container/wizard/index.js +64 -35
  50. package/components/container/wizard/utils.js +46 -1
  51. package/components/container/wizard/wizard-step/index.js +11 -1
  52. package/components/data/card/card-content/index.js +1 -1
  53. package/components/data/form/base-form/index.js +985 -183
  54. package/components/data/form/base-form/props.js +3 -1
  55. package/components/data/form/base-form/utils.js +159 -1
  56. package/components/data/form/dynamic-fields/constant.js +53 -0
  57. package/components/data/form/dynamic-fields/index.js +10 -45
  58. package/components/data/form/dynamic-fields/utils.js +37 -2
  59. package/components/data/form/form-action/index.js +5 -4
  60. package/components/data/form/form-context.js +5 -1
  61. package/components/data/form/form-controller/utils.js +84 -0
  62. package/components/data/form/form-controller/validation-contrustor.js +402 -189
  63. package/components/data/form/form-controller/withFormController.js +191 -52
  64. package/components/data/form/form-field/base-field.js +67 -45
  65. package/components/data/form/form-field/index.js +28 -5
  66. package/components/data/form/form-header/index.js +3 -4
  67. package/components/data/form/index.js +20 -1
  68. package/components/data/list/components/ListDND.js +2 -1
  69. package/components/data/list/components/ListItem.js +6 -2
  70. package/components/data/list/components/ListItemWithTemplate.js +46 -2
  71. package/components/data/list/components/ListItems.js +17 -26
  72. package/components/data/list/components/ListPagination.js +3 -3
  73. package/components/data/list/components/StandardListItems.js +3 -4
  74. package/components/data/list/hooks/useListEffects.js +55 -14
  75. package/components/data/list/hooks/useListEventHandlers.js +3 -1
  76. package/components/data/list/hooks/useListState.js +3 -1
  77. package/components/data/list/hooks/usePaginatedGroupedData.js +18 -5
  78. package/components/data/list/index.js +74 -55
  79. package/components/data/list/utils/list-helpers.js +73 -35
  80. package/components/data/list/utils/list-widget-methods.js +138 -95
  81. package/components/data/live-filter/index.js +26 -15
  82. package/components/data/live-form/index.js +51 -18
  83. package/components/data/live-form/props.js +1 -1
  84. package/components/data/pagination/components/BasicPagination.js +71 -16
  85. package/components/data/pagination/components/PageSizeSelector.js +8 -3
  86. package/components/data/pagination/components/TotalRecords.js +1 -5
  87. package/components/data/pagination/hooks/usePagination.js +349 -66
  88. package/components/data/pagination/index.js +137 -19
  89. package/components/data/table/components/AddNewRow.js +5 -1
  90. package/components/data/table/components/EditableCell.js +2 -2
  91. package/components/data/table/components/RowCells.js +64 -0
  92. package/components/data/table/components/RowExpansionButton.js +2 -2
  93. package/components/data/table/components/SummaryCell.js +111 -0
  94. package/components/data/table/components/SummaryRow.js +54 -0
  95. package/components/data/table/components/SummaryRowFooter.js +46 -0
  96. package/components/data/table/components/TableBody.js +61 -59
  97. package/components/data/table/components/TableDataRow.js +109 -0
  98. package/components/data/table/components/TableFilters.js +225 -121
  99. package/components/data/table/components/TableHeader.js +291 -23
  100. package/components/data/table/components/TablePanelHeading.js +139 -8
  101. package/components/data/table/components/index.js +22 -1
  102. package/components/data/table/hooks/use-edited-rows.js +141 -0
  103. package/components/data/table/hooks/useCellState.js +5 -12
  104. package/components/data/table/hooks/useFormWidget.js +58 -52
  105. package/components/data/table/hooks/usePaginationState.js +45 -24
  106. package/components/data/table/hooks/usePanelStructure.js +4 -4
  107. package/components/data/table/hooks/useRowHandlers.js +39 -5
  108. package/components/data/table/hooks/useRowSelection.js +244 -50
  109. package/components/data/table/hooks/useServerSideSorting.js +81 -37
  110. package/components/data/table/hooks/useTableColumns.js +211 -118
  111. package/components/data/table/hooks/useTableData.js +54 -9
  112. package/components/data/table/hooks/useTableEdit.js +272 -97
  113. package/components/data/table/hooks/useTableEffects.js +31 -13
  114. package/components/data/table/hooks/useTableFilter.js +1 -1
  115. package/components/data/table/hooks/useTableInitialization.js +23 -22
  116. package/components/data/table/hooks/useTableState.js +11 -5
  117. package/components/data/table/hooks/useTableStateManager.js +140 -65
  118. package/components/data/table/index.js +637 -274
  119. package/components/data/table/live-table/index.js +54 -22
  120. package/components/data/table/table-action/index.js +1 -1
  121. package/components/data/table/table-group/index.js +26 -0
  122. package/components/data/table/table-row-action/index.js +32 -18
  123. package/components/data/table/utils/buildSelectionColumns.js +12 -21
  124. package/components/data/table/utils/columnBuilder.js +29 -14
  125. package/components/data/table/utils/columnProxy.js +68 -1
  126. package/components/data/table/utils/constants.js +6 -2
  127. package/components/data/table/utils/crud-handlers.js +68 -63
  128. package/components/data/table/utils/groupHeaderUtils.js +102 -0
  129. package/components/data/table/utils/index.js +210 -21
  130. package/components/data/table/utils/renderDisplayCell.js +6 -6
  131. package/components/data/table/utils/selectionUtils.js +25 -26
  132. package/components/data/table/utils/validation.js +1 -0
  133. package/components/data/utils/filter-field-util.js +3 -3
  134. package/components/dialogs/alert-dialog/index.js +1 -1
  135. package/components/dialogs/confirm-dialog/index.js +1 -1
  136. package/components/dialogs/dialog/index.js +4 -1
  137. package/components/dialogs/dialog-content/index.js +3 -1
  138. package/components/dialogs/dialog-header/index.js +2 -2
  139. package/components/dialogs/iframe-dialog/index.js +11 -5
  140. package/components/dialogs/index.js +1 -1
  141. package/components/dialogs/login-dialog/index.js +1 -1
  142. package/components/dialogs/page-dialog/index.js +1 -1
  143. package/components/form/button/index.js +33 -7
  144. package/components/input/calendar/index.js +18 -6
  145. package/components/input/chips/index.js +99 -28
  146. package/components/input/chips/utils.js +34 -4
  147. package/components/input/color-picker/index.js +74 -25
  148. package/components/input/composite/index.js +3 -3
  149. package/components/input/currency/index.js +35 -49
  150. package/components/input/default/checkbox/index.js +23 -28
  151. package/components/input/default/checkboxset/index.js +38 -18
  152. package/components/input/default/checkboxset/utils.js +30 -0
  153. package/components/input/default/radioset/index.js +36 -39
  154. package/components/input/default/switch/index.js +30 -13
  155. package/components/input/epoch/date/index.js +130 -69
  156. package/components/input/epoch/date/utils.js +94 -1
  157. package/components/input/epoch/datetime/index.js +72 -22
  158. package/components/input/epoch/datetime/utils.js +49 -10
  159. package/components/input/epoch/time/index.js +68 -19
  160. package/components/input/epoch/time/utils.js +62 -14
  161. package/components/input/fileupload/Utils.js +12 -7
  162. package/components/input/fileupload/components/MultiUpload.js +2 -6
  163. package/components/input/fileupload/components/SingleUpload.js +3 -7
  164. package/components/input/fileupload/index.js +6 -10
  165. package/components/input/fileupload/useFileUpload.js +16 -5
  166. package/components/input/number/index.js +158 -43
  167. package/components/input/rating/index.js +90 -7
  168. package/components/input/select/index.js +209 -72
  169. package/components/input/slider/index.js +84 -26
  170. package/components/input/text/index.js +38 -18
  171. package/components/input/text/util.js +283 -130
  172. package/components/input/textarea/index.js +13 -10
  173. package/components/input/upload/index.js +124 -0
  174. package/components/input/upload/props.js +5 -0
  175. package/components/input/util/index.js +11 -0
  176. package/components/navbar/index.js +51 -3
  177. package/components/navbar/nav/index.js +46 -16
  178. package/components/navbar/nav-item/index.js +11 -5
  179. package/components/navigation/menu/components/ListItems.js +3 -0
  180. package/components/navigation/menu/constants.js +2 -1
  181. package/components/navigation/menu/hooks/useHoverState.hook.js +48 -0
  182. package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +37 -0
  183. package/components/navigation/menu/hooks/useTransformedDataset.hook.js +15 -0
  184. package/components/navigation/menu/index.js +326 -188
  185. package/components/navigation/menu/utils/action-task.js +14 -0
  186. package/components/navigation/menu/utils/role-filter.js +76 -0
  187. package/components/navigation/popover/index.js +105 -32
  188. package/components/page/partial-container/index.js +34 -5
  189. package/components/prefab/index.js +2 -4
  190. package/context/PrefabContext.js +10 -6
  191. package/context/WidgetProvider.js +30 -31
  192. package/core/app.service.js +1 -1
  193. package/core/constants/events.js +57 -1
  194. package/core/dialog.service.js +1 -2
  195. package/core/event-notifier.js +1 -2
  196. package/core/formatter/array-formatters.js +33 -0
  197. package/core/formatter/date-formatters.js +2 -4
  198. package/core/formatter/index.js +2 -1
  199. package/core/formatter/number-formatters.js +5 -10
  200. package/core/formatter/security-formatters.js +2 -4
  201. package/core/formatter/string-formatters.js +3 -6
  202. package/core/proxy-service.js +85 -13
  203. package/core/script-registry.js +108 -48
  204. package/core/util/common.js +4 -4
  205. package/core/util/compare.js +30 -0
  206. package/core/util/dom.js +8 -8
  207. package/core/util/index.js +16 -6
  208. package/core/util/safe-is-equal.js +156 -0
  209. package/core/util/security.js +1 -2
  210. package/core/util/utils.js +16 -7
  211. package/higherOrder/BaseApp.js +108 -65
  212. package/higherOrder/BaseDateTime.js +31 -13
  213. package/higherOrder/BasePage.js +268 -144
  214. package/higherOrder/BasePartial.js +1 -1
  215. package/higherOrder/BasePrefab.js +33 -15
  216. package/higherOrder/DataNav.js +99 -16
  217. package/higherOrder/helper.js +41 -3
  218. package/higherOrder/withBaseWrapper.js +41 -28
  219. package/hooks/useAuth.js +11 -5
  220. package/hooks/useHttp.js +280 -94
  221. package/mui-config/theme-provider.js +1 -1
  222. package/mui-config/theme.js +1 -1
  223. package/package-lock.json +717 -675
  224. package/package.json +8 -8
  225. package/store/bindActions/i18nActions.js +18 -0
  226. package/store/index.js +3 -1
  227. package/store/slices/appConfigSlice.js +2 -2
  228. package/store/slices/authSlice.js +31 -28
  229. package/store/slices/i18nSlice.js +2 -2
  230. package/store/slices/navigationSlice.js +35 -0
  231. package/store/viewport.service.js +255 -0
  232. package/utils/attr.js +35 -0
  233. package/utils/dataset-util.js +1 -2
  234. package/utils/form-state.util.js +43 -12
  235. package/utils/form-utils.js +47 -2
  236. package/utils/format-util.js +28 -13
  237. package/utils/page-params-util.js +33 -1
  238. package/utils/state-persistance.js +72 -13
  239. package/utils/transformedDataset-utils.js +35 -24
  240. package/variables/base-variable.js +12 -14
  241. package/variables/crud-variable.js +225 -0
  242. package/variables/live-variable.js +56 -20
  243. package/variables/metadata.service.js +123 -0
  244. package/variables/model-variable.js +21 -15
  245. package/variables/service-variable.js +88 -83
@@ -7,26 +7,24 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.BaseAction = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
13
  var _baseVariable = require("@wavemaker/react-runtime/variables/base-variable");
14
14
  var _lodashEs = require("lodash-es");
15
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
15
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
16
16
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
17
  var BaseAction = exports.BaseAction = /*#__PURE__*/function (_BaseVariable) {
18
- (0, _inherits2["default"])(BaseAction, _BaseVariable);
19
- var _super = _createSuper(BaseAction);
20
18
  function BaseAction(config) {
21
19
  (0, _classCallCheck2["default"])(this, BaseAction);
22
- return _super.call(this, config);
20
+ return _callSuper(this, BaseAction, [config]);
23
21
  }
24
- (0, _createClass2["default"])(BaseAction, [{
22
+ (0, _inherits2["default"])(BaseAction, _BaseVariable);
23
+ return (0, _createClass2["default"])(BaseAction, [{
25
24
  key: "setData",
26
25
  value: function setData(dataSet) {
27
26
  // @ts-ignore
28
27
  this.dataSet = (0, _lodashEs.merge)(this.config.paramProvider(), dataSet);
29
28
  }
30
29
  }]);
31
- return BaseAction;
32
30
  }(_baseVariable.BaseVariable);
@@ -7,28 +7,28 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.LoginAction = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
13
  var _baseAction = require("./base-action");
14
14
  var _baseVariable = require("../variables/base-variable");
15
15
  var _get = _interopRequireDefault(require("lodash-es/get"));
16
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
16
+ var _merge = _interopRequireDefault(require("lodash-es/merge"));
17
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
17
18
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
19
  var LoginAction = exports.LoginAction = /*#__PURE__*/function (_BaseAction) {
19
- (0, _inherits2["default"])(LoginAction, _BaseAction);
20
- var _super = _createSuper(LoginAction);
21
20
  function LoginAction(config) {
22
21
  (0, _classCallCheck2["default"])(this, LoginAction);
23
- return _super.call(this, config);
22
+ return _callSuper(this, LoginAction, [config]);
24
23
  }
25
- (0, _createClass2["default"])(LoginAction, [{
24
+ (0, _inherits2["default"])(LoginAction, _BaseAction);
25
+ return (0, _createClass2["default"])(LoginAction, [{
26
26
  key: "invoke",
27
27
  value: function invoke(options, successcb, errorcb) {
28
28
  var _this = this;
29
29
  var params;
30
30
  if (!(0, _get["default"])(options, "formData")) {
31
- params = this.config.paramProvider();
31
+ params = (0, _merge["default"])(this.config.paramProvider(), this.dataBinding);
32
32
  }
33
33
  this.notify(_baseVariable.VariableEvents.BEFORE_INVOKE, [this, params]);
34
34
  return this.config.securityService().login({
@@ -49,5 +49,4 @@ var LoginAction = exports.LoginAction = /*#__PURE__*/function (_BaseAction) {
49
49
  });
50
50
  }
51
51
  }]);
52
- return LoginAction;
53
52
  }(_baseAction.BaseAction);
@@ -7,21 +7,20 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.LogoutAction = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
13
  var _baseAction = require("./base-action");
14
14
  var _baseVariable = require("../variables/base-variable");
15
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
15
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
16
16
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
17
  var LogoutAction = exports.LogoutAction = /*#__PURE__*/function (_BaseAction) {
18
- (0, _inherits2["default"])(LogoutAction, _BaseAction);
19
- var _super = _createSuper(LogoutAction);
20
18
  function LogoutAction(config) {
21
19
  (0, _classCallCheck2["default"])(this, LogoutAction);
22
- return _super.call(this, config);
20
+ return _callSuper(this, LogoutAction, [config]);
23
21
  }
24
- (0, _createClass2["default"])(LogoutAction, [{
22
+ (0, _inherits2["default"])(LogoutAction, _BaseAction);
23
+ return (0, _createClass2["default"])(LogoutAction, [{
25
24
  key: "invoke",
26
25
  value: function invoke(options, successcb, errorcb) {
27
26
  var _this = this;
@@ -37,5 +36,4 @@ var LogoutAction = exports.LogoutAction = /*#__PURE__*/function (_BaseAction) {
37
36
  });
38
37
  }
39
38
  }]);
40
- return LogoutAction;
41
39
  }(_baseAction.BaseAction);
@@ -8,34 +8,45 @@ exports.NavigationAction = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
15
  var _baseVariable = require("@wavemaker/react-runtime/variables/base-variable");
16
16
  var _baseAction = require("./base-action");
17
17
  var _lodashEs = require("lodash-es");
18
18
  var _navigationMiddleware = require("@wavemaker/react-runtime/store/middleware/navigationMiddleware");
19
19
  var _constants = require("../core/constants");
20
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
20
+ var _store = require("@wavemaker/react-runtime/store");
21
+ var _navigationSlice = require("@wavemaker/react-runtime/store/slices/navigationSlice");
22
+ var _statePersistance = require("@wavemaker/react-runtime/utils/state-persistance");
23
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
21
24
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
25
+ function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
22
26
  var NavigationAction = exports.NavigationAction = /*#__PURE__*/function (_BaseAction) {
23
- (0, _inherits2["default"])(NavigationAction, _BaseAction);
24
- var _super = _createSuper(NavigationAction);
25
27
  function NavigationAction(config) {
26
28
  (0, _classCallCheck2["default"])(this, NavigationAction);
27
- return _super.call(this, config);
29
+ return _callSuper(this, NavigationAction, [config]);
28
30
  }
29
- (0, _createClass2["default"])(NavigationAction, [{
31
+ (0, _inherits2["default"])(NavigationAction, _BaseAction);
32
+ return (0, _createClass2["default"])(NavigationAction, [{
30
33
  key: "invoke",
31
34
  value: function invoke(params, onSuccess, onError) {
32
35
  var _params,
33
36
  _this = this;
34
37
  var config = this.config;
38
+
39
+ // Mark page navigation as pending SYNCHRONOUSLY before any async operations.
40
+ // This prevents URL state persistence (router.replace) from overwriting the navigation (router.push)
41
+ // when click events bubble up to parent widgets (like List) that persist state.
42
+ if (config.operation === "gotoPage" || config.operation === "goToPreviousPage") {
43
+ (0, _statePersistance.markPageNavigationPending)();
44
+ }
45
+
35
46
  // @ts-ignore
36
- params = (_params = params) !== null && _params !== void 0 && _params.data ? (0, _lodashEs.merge)(this.config.paramProvider(), params.data) : (0, _lodashEs.merge)(this.config.paramProvider(), this.dataSet);
47
+ params = (_params = params) !== null && _params !== void 0 && _params.data ? (0, _lodashEs.merge)(this.config.paramProvider(), this.dataBinding, params.data) : (0, _lodashEs.merge)(this.config.paramProvider(), this.dataBinding, this.dataSet);
37
48
  this.notify(_baseVariable.VariableEvents.BEFORE_INVOKE, [this, this.dataSet]);
38
- return (0, _get2["default"])((0, _getPrototypeOf2["default"])(NavigationAction.prototype), "invoke", this).call(this, params, onSuccess, onError).then(function () {
49
+ return _superPropGet(NavigationAction, "invoke", this, 3)([params, onSuccess, onError]).then(function () {
39
50
  switch (config.operation) {
40
51
  case "goToPreviousPage":
41
52
  _this.handleGoToPreviousPage();
@@ -55,6 +66,8 @@ var NavigationAction = exports.NavigationAction = /*#__PURE__*/function (_BaseAc
55
66
  }, function () {
56
67
  config.onError && config.onError(_this, null);
57
68
  _this.notify(_baseVariable.VariableEvents.ERROR, [_this, _this.dataSet]);
69
+ // Clear the flag on error so future state persistence works
70
+ (0, _statePersistance.clearPageNavigationPending)();
58
71
  }).then(function () {
59
72
  _this.notify(_baseVariable.VariableEvents.AFTER_INVOKE, [_this, _this.dataSet]);
60
73
  return _this;
@@ -91,21 +104,64 @@ var NavigationAction = exports.NavigationAction = /*#__PURE__*/function (_BaseAc
91
104
  }, {
92
105
  key: "handleGotoTab",
93
106
  value: function handleGotoTab(params) {
94
- var _this$config$_context;
95
107
  var tabName = params === null || params === void 0 ? void 0 : params.tabName;
96
- if (tabName && (_this$config$_context = this.config._context) !== null && _this$config$_context !== void 0 && (_this$config$_context = _this$config$_context.Widgets[tabName]) !== null && _this$config$_context !== void 0 && _this$config$_context.select) {
97
- this.config._context.Widgets[tabName].select();
98
- } else {
99
- console.warn("Unable to select tab: ".concat(tabName));
108
+ var pageName = params === null || params === void 0 ? void 0 : params.pageName;
109
+ if (!tabName) {
110
+ console.warn("No tab name provided for navigation");
111
+ return;
100
112
  }
113
+
114
+ // Try to find the tab widget in the widget hierarchy
115
+ var tabWidget = this.findTabWidget(tabName);
116
+
117
+ // If tab found in current context hierarchy, select it directly
118
+ // This handles same-page tab navigation (partial to page tab on same page)
119
+ if (tabWidget !== null && tabWidget !== void 0 && tabWidget.select) {
120
+ tabWidget.select();
121
+ return;
122
+ }
123
+
124
+ // If pageName is provided, navigate to that page first and then select the tab
125
+ // This handles cross-page tab navigation
126
+ if (pageName) {
127
+ // Store the tab selection intent in Redux as fallback
128
+ _store.store.dispatch((0, _navigationSlice.setPendingTabSelection)(tabName));
129
+ // Navigate to the page with tabName in URL query params
130
+ // The tabName will be included in URL params by handleGotoPage
131
+ this.handleGotoPage(params);
132
+ return;
133
+ }
134
+ console.warn("Unable to select tab: ".concat(tabName, ". Tab widget not found in context hierarchy and no pageName provided."));
135
+ }
136
+ }, {
137
+ key: "findTabWidget",
138
+ value: function findTabWidget(tabName) {
139
+ var _context$Widgets;
140
+ var context = this.config._context;
141
+
142
+ // 1. Check in current context (works for tabs in same partial/page)
143
+ if (context !== null && context !== void 0 && (_context$Widgets = context.Widgets) !== null && _context$Widgets !== void 0 && _context$Widgets[tabName]) {
144
+ return context.Widgets[tabName];
145
+ }
146
+ return null;
101
147
  }
102
148
  }, {
103
149
  key: "handleGotoAccordion",
104
150
  value: function handleGotoAccordion(params) {
105
- var _this$config$_context2;
151
+ var _this$config$_context;
106
152
  var accordionName = params === null || params === void 0 ? void 0 : params.accordionName;
107
- if (accordionName && (_this$config$_context2 = this.config._context) !== null && _this$config$_context2 !== void 0 && (_this$config$_context2 = _this$config$_context2.Widgets[accordionName]) !== null && _this$config$_context2 !== void 0 && _this$config$_context2.expand) {
108
- this.config._context.Widgets[accordionName].expand();
153
+ var pageName = params === null || params === void 0 ? void 0 : params.pageName;
154
+
155
+ // If on the same page, expand the accordion directly
156
+ if (accordionName && (_this$config$_context = this.config._context) !== null && _this$config$_context !== void 0 && (_this$config$_context = _this$config$_context.Widgets[accordionName]) !== null && _this$config$_context !== void 0 && _this$config$_context.expand) {
157
+ var _this$config$_context2;
158
+ (_this$config$_context2 = this.config._context) === null || _this$config$_context2 === void 0 || (_this$config$_context2 = _this$config$_context2.Widgets[accordionName]) === null || _this$config$_context2 === void 0 || _this$config$_context2.expand();
159
+ } else if (pageName && accordionName) {
160
+ // If navigating to a different page, store accordion name in Redux and navigate
161
+ // Store the accordion expansion intent in Redux to be executed after page load
162
+ _store.store.dispatch((0, _navigationSlice.setPendingAccordionExpansion)(accordionName));
163
+ // Navigate to the page
164
+ this.handleGotoPage(params);
109
165
  } else {
110
166
  console.warn("Unable to expand accordion: ".concat(accordionName));
111
167
  }
@@ -143,5 +199,4 @@ var NavigationAction = exports.NavigationAction = /*#__PURE__*/function (_BaseAc
143
199
  }
144
200
  }
145
201
  }]);
146
- return NavigationAction;
147
202
  }(_baseAction.BaseAction);
@@ -8,17 +8,19 @@ exports.NotificationAction = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
15
  var _baseAction = require("./base-action");
15
16
  var _baseVariable = require("@wavemaker/react-runtime/variables/base-variable");
16
17
  var _lodashEs = require("lodash-es");
17
18
  var _toast = require("./toast.service");
18
19
  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; }
19
20
  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) { (0, _defineProperty2["default"])(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; }
20
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
21
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
21
22
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
+ function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
22
24
  var DEFAULT_DURATION = 3000;
23
25
  var NOTIFICATION_TYPE = {
24
26
  success: "success",
@@ -28,18 +30,30 @@ var NOTIFICATION_TYPE = {
28
30
  info: "info"
29
31
  };
30
32
  var NotificationAction = exports.NotificationAction = /*#__PURE__*/function (_BaseAction) {
31
- (0, _inherits2["default"])(NotificationAction, _BaseAction);
32
- var _super = _createSuper(NotificationAction);
33
33
  function NotificationAction(config) {
34
34
  (0, _classCallCheck2["default"])(this, NotificationAction);
35
- return _super.call(this, config);
35
+ return _callSuper(this, NotificationAction, [config]);
36
36
  }
37
- (0, _createClass2["default"])(NotificationAction, [{
37
+
38
+ // Backward-compatible API: used `notify()`. Support both shapes.
39
+ (0, _inherits2["default"])(NotificationAction, _BaseAction);
40
+ return (0, _createClass2["default"])(NotificationAction, [{
41
+ key: "notify",
42
+ value: function notify(arg1, arg2, arg3) {
43
+ if (typeof arg1 === "string") {
44
+ // Delegate to BaseAction event notifier
45
+ return _superPropGet(NotificationAction, "notify", this, 3)([arg1, Array.isArray(arg2) ? arg2 : [], typeof arg3 === "boolean" ? arg3 : false]);
46
+ }
47
+ // Backward-compat path for notify()
48
+ return this.invoke(arg1, arg2, arg3);
49
+ }
50
+ }, {
38
51
  key: "prepareToastOptions",
39
52
  value: function prepareToastOptions() {
40
53
  var _String$toLowerCase,
41
54
  _String,
42
55
  _mergedParams$toaster,
56
+ _mergedParams$showTyp,
43
57
  _this = this;
44
58
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
45
59
  var configParams = this.config.paramProvider();
@@ -48,7 +62,7 @@ var NotificationAction = exports.NotificationAction = /*#__PURE__*/function (_Ba
48
62
  var type = NOTIFICATION_TYPE[alertClass] || "info";
49
63
 
50
64
  // get toast position
51
- var position = (_mergedParams$toaster = mergedParams.toasterPosition) !== null && _mergedParams$toaster !== void 0 ? _mergedParams$toaster : "top right";
65
+ var position = (_mergedParams$toaster = mergedParams.toasterPosition) !== null && _mergedParams$toaster !== void 0 ? _mergedParams$toaster : "bottom right";
52
66
 
53
67
  // Determine duration (0 means stay until dismissed)
54
68
  var duration = parseInt(String(mergedParams.duration));
@@ -66,6 +80,7 @@ var NotificationAction = exports.NotificationAction = /*#__PURE__*/function (_Ba
66
80
  name: this.name,
67
81
  styles: mergedParams.styles || {},
68
82
  hideOnClick: mergedParams.hideOnClick !== false,
83
+ showTypeLabel: (_mergedParams$showTyp = mergedParams.showTypeLabel) !== null && _mergedParams$showTyp !== void 0 ? _mergedParams$showTyp : false,
69
84
  onClose: function onClose() {
70
85
  if (_this.config.onClose) {
71
86
  _this.config.onClose(_this, null);
@@ -146,5 +161,4 @@ var NotificationAction = exports.NotificationAction = /*#__PURE__*/function (_Ba
146
161
  key: "getMessage",
147
162
  value: function getMessage() {}
148
163
  }]);
149
- return NotificationAction;
150
164
  }(_baseAction.BaseAction);
@@ -7,31 +7,30 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.TimerAction = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
15
  var _baseAction = require("./base-action");
17
16
  var _baseVariable = require("@wavemaker/react-runtime/variables/base-variable");
18
17
  var _lodashEs = require("lodash-es");
19
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
18
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
20
19
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20
+ function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
21
21
  var TimerAction = exports.TimerAction = /*#__PURE__*/function (_BaseAction) {
22
- (0, _inherits2["default"])(TimerAction, _BaseAction);
23
- var _super = _createSuper(TimerAction);
24
22
  function TimerAction(config) {
25
23
  var _this;
26
24
  (0, _classCallCheck2["default"])(this, TimerAction);
27
- _this = _super.call(this, config);
28
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_timerId", -1);
29
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_isActive", false);
30
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onSuccess", void 0);
31
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onError", void 0);
25
+ _this = _callSuper(this, TimerAction, [config]);
26
+ (0, _defineProperty2["default"])(_this, "_timerId", -1);
27
+ (0, _defineProperty2["default"])(_this, "_isActive", false);
28
+ (0, _defineProperty2["default"])(_this, "_onSuccess", void 0);
29
+ (0, _defineProperty2["default"])(_this, "_onError", void 0);
32
30
  return _this;
33
31
  }
34
- (0, _createClass2["default"])(TimerAction, [{
32
+ (0, _inherits2["default"])(TimerAction, _BaseAction);
33
+ return (0, _createClass2["default"])(TimerAction, [{
35
34
  key: "invoke",
36
35
  value: function invoke(params, onSuccess, onError) {
37
36
  var _params,
@@ -40,7 +39,7 @@ var TimerAction = exports.TimerAction = /*#__PURE__*/function (_BaseAction) {
40
39
 
41
40
  // Notify that we're about to invoke
42
41
  this.notify(_baseVariable.VariableEvents.BEFORE_INVOKE, [this, this.dataSet]);
43
- return (0, _get2["default"])((0, _getPrototypeOf2["default"])(TimerAction.prototype), "invoke", this).call(this, params, onSuccess, onError).then(function () {
42
+ return _superPropGet(TimerAction, "invoke", this, 3)([params, onSuccess, onError]).then(function () {
44
43
  // Start the timer
45
44
  _this2.startTimer();
46
45
 
@@ -157,8 +156,7 @@ var TimerAction = exports.TimerAction = /*#__PURE__*/function (_BaseAction) {
157
156
  key: "destroy",
158
157
  value: function destroy() {
159
158
  this.cancel();
160
- (0, _get2["default"])((0, _getPrototypeOf2["default"])(TimerAction.prototype), "destroy", this).call(this);
159
+ _superPropGet(TimerAction, "destroy", this, 3)([]);
161
160
  }
162
161
  }]);
163
- return TimerAction;
164
162
  }(_baseAction.BaseAction);
package/actions/toast.js CHANGED
@@ -34,7 +34,9 @@ var CustomToast = function CustomToast(_ref) {
34
34
  type = _toast$type === void 0 ? "info" : _toast$type,
35
35
  _toast$position = toast.position,
36
36
  position = _toast$position === void 0 ? toast.placement || _types.TOAST_CONFIG.DEFAULT_POSITION : _toast$position,
37
- onClick = toast.onClick;
37
+ onClick = toast.onClick,
38
+ _toast$showTypeLabel = toast.showTypeLabel,
39
+ showTypeLabel = _toast$showTypeLabel === void 0 ? false : _toast$showTypeLabel;
38
40
  var ispage = toast.content && (0, _typeof2["default"])(toast.content) === "object";
39
41
  var handleClick = function handleClick(e) {
40
42
  if (onClick) {
@@ -79,7 +81,7 @@ var CustomToast = function CustomToast(_ref) {
79
81
  disableWindowBlurListener: true,
80
82
  message: __jsx("div", {
81
83
  className: "toast-title"
82
- }, type.toUpperCase(), __jsx("div", {
84
+ }, showTypeLabel && type.toUpperCase(), __jsx("div", {
83
85
  className: "toast-message"
84
86
  }, text)),
85
87
  TransitionProps: {
@@ -28,7 +28,7 @@ var ToastService = /*#__PURE__*/function () {
28
28
  this.setContext = this.setContext.bind(this);
29
29
  ToastService.instance = this;
30
30
  }
31
- (0, _createClass2["default"])(ToastService, [{
31
+ return (0, _createClass2["default"])(ToastService, [{
32
32
  key: "setContext",
33
33
  value: function setContext(context) {
34
34
  this.context = context;
@@ -75,7 +75,6 @@ var ToastService = /*#__PURE__*/function () {
75
75
  this.context.hideAllToasts();
76
76
  }
77
77
  }]);
78
- return ToastService;
79
78
  }(); // Create singleton instance
80
79
  _ToastService = ToastService;
81
80
  (0, _defineProperty2["default"])(ToastService, "instance", void 0);
@@ -188,7 +188,7 @@ var WmCarousel = /*#__PURE__*/(0, _react.memo)(function (props) {
188
188
  return newIndex;
189
189
  });
190
190
  }
191
- }, animationinterval * 1000);
191
+ }, animationinterval * 500);
192
192
  }
193
193
  }, [animation, animationinterval, itemCount, isPaused]);
194
194
  var stopAutoPlay = (0, _react.useCallback)(function () {
@@ -18,7 +18,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
18
18
  var __jsx = _react["default"].createElement;
19
19
  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; }
20
20
  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) { (0, _defineProperty2["default"])(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; }
21
- var DEFAULT_CLASS = "app-carousel-item";
21
+ var DEFAULT_CLASS = "app-carousel-item item";
22
22
  var WmCarouselTemplate = /*#__PURE__*/(0, _react.memo)(function (props) {
23
23
  var name = props.name,
24
24
  _props$horizontalalig = props.horizontalalign,
@@ -18,20 +18,20 @@ var _Link = _interopRequireDefault(require("@mui/material/Link"));
18
18
  var _Badge = _interopRequireDefault(require("@mui/material/Badge"));
19
19
  var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
20
20
  var _utils = require("../../../core/util/utils");
21
- var _excluded = ["caption", "iconclass", "styles", "className", "iconheight", "iconwidth", "iconmargin", "iconurl", "iconposition", "badgevalue", "listener", "hyperlink", "encodeurl", "onClick", "shortcutkey", "arialabel", "target", "itemLink"];
21
+ var _excluded = ["caption", "iconclass", "styles", "className", "iconheight", "iconwidth", "iconmargin", "iconurl", "iconposition", "badgevalue", "listener", "hyperlink", "encodeurl", "onClick", "shortcutkey", "arialabel", "target", "itemLink", "href"];
22
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
23
23
  var __jsx = _react["default"].createElement;
24
24
  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; }
25
25
  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) { (0, _defineProperty2["default"])(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; }
26
26
  // Define regex outside component to avoid recreation on each render
27
- var GO_TO_PAGE_REGEX = /(?:\w+\?\.)?Actions(?:\?\.)?goToPage_(\w+)(?:\?\.)?invoke\(\)/;
27
+ var GO_TO_PAGE_REGEX = /(?:\w+\?\.)?Actions(?:\?\.)?goToPage_(\w+)(?:\?\.)?invoke(?:\?\.)?\(\)/;
28
28
  var DEFAULT_CLASS = "app-anchor";
29
29
  var getCurrentPageName = function getCurrentPageName(pathname) {
30
30
  var segments = pathname.split("/").filter(Boolean);
31
31
  return segments[segments.length - 1];
32
32
  };
33
33
  var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
34
- var _clsx, _listener$appLocale;
34
+ var _listener$appLocale;
35
35
  var _props$caption = props.caption,
36
36
  caption = _props$caption === void 0 ? "Link" : _props$caption,
37
37
  iconclass = props.iconclass,
@@ -52,11 +52,13 @@ var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
52
52
  arialabel = props.arialabel,
53
53
  target = props.target,
54
54
  itemLink = props.itemLink,
55
+ _ignoredHref = props.href,
55
56
  restProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
56
57
  var path = (0, _utils.getCurrentPath)();
57
58
  var _useState = (0, _react.useState)(false),
58
59
  isActive = _useState[0],
59
60
  setIsActive = _useState[1];
61
+ var linkRef = (0, _react.useRef)(null);
60
62
 
61
63
  // Extract navigation info from onClick
62
64
  var navigationInfo = (0, _react.useMemo)(function () {
@@ -119,6 +121,16 @@ var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
119
121
  setIsActive(activeByHyperlink || activeByNavigationExpr);
120
122
  }, [caption, path, doesHyperlinkMatchCurrentPath, navigationInfo.isCurrentPage, itemLink]);
121
123
 
124
+ // Compute href directly for use in render instead of useEffect
125
+ // This ensures the href is set correctly from the first render
126
+ var computedHref = (0, _react.useMemo)(function () {
127
+ if (!hyperlink) {
128
+ // Same as Angular: if no hyperlink, set javascript:void(0)
129
+ return "javascript:void(0)";
130
+ }
131
+ return processedHyperlink;
132
+ }, [hyperlink, processedHyperlink]);
133
+
122
134
  // Calculate icon position styles
123
135
  var iconPositionStyles = (0, _react.useMemo)(function () {
124
136
  if (iconposition === "top") {
@@ -136,7 +148,7 @@ var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
136
148
  e.preventDefault();
137
149
  }
138
150
  if (onClick) {
139
- onClick(e);
151
+ onClick(e, props);
140
152
  }
141
153
  };
142
154
  function handleMouseEnter(event) {
@@ -176,21 +188,27 @@ var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
176
188
  onFocus: handleFocus
177
189
  }), props.onBlur && {
178
190
  onBlur: handleBlur
179
- }), props.onClick && {
191
+ }), {}, {
192
+ // Always attach onClick to ensure preventDefault is called when there's no hyperlink
180
193
  onClick: handleClick
181
194
  });
182
195
  var iconstyles = {
183
- height: iconheight || "auto",
184
- width: iconwidth || "auto",
196
+ height: iconheight,
197
+ width: iconwidth,
185
198
  margin: iconmargin || "0 4"
186
199
  };
187
- return __jsx(_Link["default"], (0, _extends2["default"])({}, domEvents, {
200
+ return __jsx(_Link["default"], (0, _extends2["default"])({
201
+ ref: linkRef,
202
+ href: computedHref
203
+ }, domEvents, {
188
204
  style: _objectSpread(_objectSpread({}, iconPositionStyles), styles),
205
+ sx: {
206
+ padding: 0
207
+ },
189
208
  caption: caption,
190
209
  role: "link",
191
210
  tabIndex: props.tabindex,
192
- className: (0, _clsx2["default"])((_clsx = {}, (0, _defineProperty2["default"])(_clsx, DEFAULT_CLASS, true), (0, _defineProperty2["default"])(_clsx, className || "", Boolean(className)), (0, _defineProperty2["default"])(_clsx, "active", isActive), _clsx)),
193
- href: processedHyperlink,
211
+ className: (0, _clsx2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, DEFAULT_CLASS, true), className || "", Boolean(className)), "active", isActive)),
194
212
  onContextMenu: handleContextMenu,
195
213
  accessKey: shortcutkey,
196
214
  "aria-label": arialabel || (badgevalue && caption ? "".concat(caption, " ").concat(badgevalue) : caption) || null,
@@ -198,7 +216,9 @@ var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
198
216
  target: target,
199
217
  title: props.hint,
200
218
  "data-identifier": "anchor"
201
- }, restProps), iconurl && __jsx(_image["default"], {
219
+ }, restProps, {
220
+ name: props.name
221
+ }), iconurl && __jsx(_image["default"], {
202
222
  alt: "Image",
203
223
  src: iconurl,
204
224
  className: (0, _clsx2["default"])("anchor-image-icon", iconclass),