@wavemaker-ai/react-runtime 1.0.0-rc.326 → 1.0.0-rc.328

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 (80) hide show
  1. package/components/basic/icon/index.js +36 -5
  2. package/components/basic/iframe/index.js +18 -8
  3. package/components/basic/label/index.js +4 -3
  4. package/components/basic/search/index.d.ts +72 -3
  5. package/components/basic/search/index.js +75 -21
  6. package/components/basic/search/props.d.ts +4 -0
  7. package/components/common/WmAppIcon/index.js +11 -8
  8. package/components/common/WmAppIcon/props.d.ts +2 -0
  9. package/components/container/accordion/accordion-pane/index.d.ts +1 -0
  10. package/components/container/accordion/accordion-pane/index.js +7 -3
  11. package/components/container/accordion/accordion-pane/props.d.ts +1 -0
  12. package/components/container/index.js +13 -5
  13. package/components/container/panel/components/panel-header/index.js +1 -3
  14. package/components/container/tabs/tab-pane/index.d.ts +1 -0
  15. package/components/container/tabs/tab-pane/index.js +2 -2
  16. package/components/container/tabs/tab-pane/props.d.ts +1 -0
  17. package/components/container/wizard/index.js +11 -10
  18. package/components/container/wizard/utils.js +1 -0
  19. package/components/data/form/dynamic-fields/WmxDynamicFormField.d.ts +11 -0
  20. package/components/data/form/dynamic-fields/WmxDynamicFormField.js +77 -0
  21. package/components/data/form/dynamic-fields/index.js +12 -1
  22. package/components/data/form/form-controller/withFormController.js +0 -14
  23. package/components/data/form/form-field/index.js +10 -7
  24. package/components/data/list/index.js +3 -2
  25. package/components/data/table/components/RowCells.js +3 -1
  26. package/components/data/table/components/TableHeader.js +5 -1
  27. package/components/data/table/hooks/useRowHandlers.d.ts +4 -2
  28. package/components/data/table/hooks/useRowHandlers.js +23 -11
  29. package/components/data/table/hooks/useRowSelection.d.ts +1 -1
  30. package/components/data/table/hooks/useRowSelection.js +80 -66
  31. package/components/data/table/hooks/useTableState.js +14 -2
  32. package/components/data/table/index.js +52 -48
  33. package/components/data/table/props.d.ts +4 -0
  34. package/components/data/table/utils/buildSelectionColumns.js +2 -2
  35. package/components/data/table/utils/columnBuilder.js +1 -1
  36. package/components/data/table/utils/index.d.ts +9 -1
  37. package/components/data/table/utils/index.js +15 -1
  38. package/components/data/table/utils/selectionUtils.d.ts +5 -0
  39. package/components/data/table/utils/selectionUtils.js +5 -0
  40. package/components/dialogs/dialog-header/index.js +1 -1
  41. package/components/dialogs/index.js +14 -2
  42. package/components/input/chips/index.js +29 -5
  43. package/components/input/color-picker/index.js +4 -6
  44. package/components/input/epoch/date/index.js +1 -1
  45. package/components/input/select/index.js +3 -4
  46. package/components/input/text/index.js +2 -2
  47. package/components/input/textarea/index.js +41 -16
  48. package/components/navbar/nav/index.js +10 -5
  49. package/components/navigation/breadcrumb/index.js +2 -1
  50. package/components/navigation/popover/index.js +9 -1
  51. package/components/page/page-content/index.js +24 -4
  52. package/components/page/page-content/props.d.ts +1 -0
  53. package/components/page/partial-container/index.js +1 -1
  54. package/components/wmx/WmxRenderer.d.ts +8 -0
  55. package/components/wmx/WmxRenderer.js +57 -0
  56. package/core/appstore.js +1 -1
  57. package/core/util/index.d.ts +0 -2
  58. package/core/util/index.js +0 -29
  59. package/higherOrder/BasePage.js +24 -63
  60. package/higherOrder/DataNav.js +4 -1
  61. package/hooks/useHttp.js +4 -2
  62. package/hooks/useLayoutSize.js +1 -1
  63. package/package-lock.json +196 -552
  64. package/package.json +3 -3
  65. package/runtime-dynamic/app-initializer.js +2 -1
  66. package/runtime-dynamic/components/partial-content.js +2 -1
  67. package/runtime-dynamic/components/wmx-placeholder.d.ts +18 -0
  68. package/runtime-dynamic/components/wmx-placeholder.js +48 -0
  69. package/runtime-dynamic/main.js +6 -0
  70. package/runtime-dynamic/services/compile-render.js +75 -12
  71. package/store/slices/i18nSlice.d.ts +0 -1
  72. package/store/slices/i18nSlice.js +0 -2
  73. package/utils/layoutsize-util.js +12 -7
  74. package/utils/style-utils.d.ts +6 -0
  75. package/utils/style-utils.js +10 -0
  76. package/utils/wmx.utils.d.ts +6 -0
  77. package/utils/wmx.utils.js +41 -0
  78. package/variables/crud-variable.js +1 -1
  79. package/variables/live-variable.js +1 -1
  80. package/variables/service-variable.js +6 -3
@@ -38,7 +38,7 @@ const WmDialogHeader = (props) => {
38
38
  variant,
39
39
  id: titleid,
40
40
  component: variant,
41
- sx: { display: "flex", alignItems: "center" },
41
+ sx: { display: "flex", alignItems: "center", fontWeight: "bold" },
42
42
  className: "app-dialog-title modal-title",
43
43
  children: [
44
44
  isDialog ? iconclass && iconclass.trim() !== "" || iconurl && iconurl !== "" ? /* @__PURE__ */ jsx(
@@ -18,11 +18,13 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { jsx } from "react/jsx-runtime";
21
- import React, { memo, useEffect } from "react";
21
+ import React, { memo, useEffect, useMemo } from "react";
22
22
  import Dialog from "@mui/material/Dialog";
23
23
  import Fade from "@mui/material/Fade";
24
24
  import clsx from "clsx";
25
+ import { useAppState } from "../../context/WidgetProvider";
25
26
  import { Box } from "@mui/material";
27
+ import { getFragmentCssScopeClass } from "../../utils/style-utils";
26
28
  const DEFAULT_CLASS = "modal fade in";
27
29
  const FadeTransition = React.forwardRef(function FadeTransition2(props, ref) {
28
30
  return /* @__PURE__ */ jsx(
@@ -56,6 +58,16 @@ const useBodyScrollLock = (lock) => {
56
58
  const WmDialog = memo((props) => {
57
59
  const { children, className, open = false, onClose, modal = false, onTransitionEntered } = props;
58
60
  useBodyScrollLock(open);
61
+ const appState = useAppState();
62
+ const cssScopeClass = useMemo(
63
+ () => getFragmentCssScopeClass({
64
+ componentName: appState == null ? void 0 : appState.componentName,
65
+ name: appState == null ? void 0 : appState.name,
66
+ componentType: appState == null ? void 0 : appState.componentType,
67
+ type: appState == null ? void 0 : appState.type
68
+ }),
69
+ [appState == null ? void 0 : appState.componentName, appState == null ? void 0 : appState.name, appState == null ? void 0 : appState.componentType, appState == null ? void 0 : appState.type]
70
+ );
59
71
  const transitionType = FadeTransition;
60
72
  const pageRef = document.getElementsByClassName("app-page")[0] || null;
61
73
  const handleClose = (event, reason) => {
@@ -130,7 +142,7 @@ const WmDialog = memo((props) => {
130
142
  width: "var(--wm-modal-full-screen-width)"
131
143
  }, sheetPositionStyles))
132
144
  },
133
- children: /* @__PURE__ */ jsx(Box, { className: clsx(className), children })
145
+ children: /* @__PURE__ */ jsx("div", { className: clsx(cssScopeClass), children: /* @__PURE__ */ jsx(Box, { className: clsx(className), children }) })
134
146
  })
135
147
  );
136
148
  });
@@ -100,6 +100,10 @@ const WmChips = React.memo(
100
100
  const [uniqueKeyCounter, setUniqueKeyCounter] = useState(0);
101
101
  const [isInitialized, setIsInitialized] = useState(false);
102
102
  const backspaceArmedRef = useRef(false);
103
+ const chipsListRef = useRef(chipsList);
104
+ chipsListRef.current = chipsList;
105
+ const modelByValueRef = useRef(modelByValue);
106
+ modelByValueRef.current = modelByValue;
103
107
  const maxSizeReached = "Max size reached";
104
108
  const isFullWidth = inputwidth === "full";
105
109
  const generateStableKeyCb = useCallback(
@@ -219,7 +223,20 @@ const WmChips = React.memo(
219
223
  };
220
224
  newChipsList.push(chipObj);
221
225
  } else {
222
- searchQuery2.push(val);
226
+ const existingChip = chipsListRef.current.find((chip) => {
227
+ var _a2, _b;
228
+ const chipModelValue = (_b = (_a2 = chip.dataObject) == null ? void 0 : _a2[datafield]) != null ? _b : chip.value;
229
+ return isEqual(chip.value, val) || isEqual(chipModelValue, val);
230
+ });
231
+ if (existingChip) {
232
+ newChipsList.push(__spreadProps(__spreadValues({}, existingChip), {
233
+ key: generateStableKeyCb(existingChip.value, i),
234
+ active: false,
235
+ isDuplicate: false
236
+ }));
237
+ } else {
238
+ searchQuery2.push(val);
239
+ }
223
240
  }
224
241
  });
225
242
  if (searchQuery2.length && datafield !== "All Fields") {
@@ -248,16 +265,23 @@ const WmChips = React.memo(
248
265
  const debouncedUpdateQueryModel = useMemo(() => {
249
266
  return debounce(updateQueryModel, 150);
250
267
  }, [updateQueryModel]);
268
+ const debouncedUpdateQueryModelRef = useRef(debouncedUpdateQueryModel);
269
+ useEffect(() => {
270
+ debouncedUpdateQueryModelRef.current = debouncedUpdateQueryModel;
271
+ }, [debouncedUpdateQueryModel]);
251
272
  useEffect(() => {
252
273
  if (isInitialized && datavalue !== void 0) {
253
- debouncedUpdateQueryModel(datavalue);
274
+ if (isEqual(datavalue, modelByValueRef.current)) {
275
+ return;
276
+ }
277
+ debouncedUpdateQueryModelRef.current(datavalue);
254
278
  } else if (datavalue == void 0 || datavalue.length == 0) {
255
279
  setChipsList([]);
256
280
  setSearchQuery(void 0);
257
281
  setModelByValue([]);
258
282
  updateMaxSize(0);
259
283
  }
260
- }, [datavalue, debouncedUpdateQueryModel]);
284
+ }, [datavalue, isInitialized]);
261
285
  const addItem = useCallback(
262
286
  (newItem) => {
263
287
  performAddItem(
@@ -447,7 +471,7 @@ const WmChips = React.memo(
447
471
  formEl.removeEventListener("wmformreset", handleFormReset);
448
472
  };
449
473
  }, []);
450
- const renderChipsList = () => {
474
+ const RenderChipsList = () => {
451
475
  const sensors = useSensors(
452
476
  useSensor(PointerSensor, {
453
477
  activationConstraint: { distance: 5 }
@@ -624,7 +648,7 @@ const WmChips = React.memo(
624
648
  className: "wm-chips-root",
625
649
  ref: rootRef,
626
650
  style: __spreadValues({ width, height }, styles),
627
- children: renderChipsList()
651
+ children: RenderChipsList()
628
652
  }
629
653
  );
630
654
  },
@@ -513,8 +513,8 @@ const WmColorPicker = memo(
513
513
  window.removeEventListener("resize", updatePosition);
514
514
  };
515
515
  }, [isOpen, calculatePosition, setPickerPosition]);
516
- const checkPlaceholder = () => {
517
- setTimeout(() => {
516
+ useEffect(() => {
517
+ const timeoutId = setTimeout(() => {
518
518
  var _a2;
519
519
  const captionEl = (_a2 = containerRef.current) == null ? void 0 : _a2.closest(".app-composite-widget.caption-floating");
520
520
  if (captionEl && !captionEl.classList.contains("float-active")) {
@@ -523,10 +523,8 @@ const WmColorPicker = memo(
523
523
  setPlaceholder(placeholder);
524
524
  }
525
525
  }, 100);
526
- };
527
- useEffect(() => {
528
- checkPlaceholder();
529
- }, [inputValue, isInteractingWithPicker]);
526
+ return () => clearTimeout(timeoutId);
527
+ }, [inputValue, isInteractingWithPicker, placeholder]);
530
528
  return /* @__PURE__ */ jsxs(
531
529
  Box,
532
530
  {
@@ -69,7 +69,7 @@ const WmDate = forwardRef((props, ref) => {
69
69
  onMouseEnter,
70
70
  onMouseLeave,
71
71
  onBeforeload,
72
- placeholder = "Select Date",
72
+ placeholder = "Select date",
73
73
  tabindex = 0,
74
74
  datepattern: datepatternProp,
75
75
  outputformat = "yyyy-MM-dd",
@@ -47,7 +47,7 @@ const WmSelect = React.memo(
47
47
  name,
48
48
  styles,
49
49
  orderby,
50
- placeholder,
50
+ placeholder = "Select value",
51
51
  readonly = false,
52
52
  required = false,
53
53
  shortcutkey,
@@ -334,7 +334,7 @@ const WmSelect = React.memo(
334
334
  }
335
335
  prevComputedValueRef.current = currentValue;
336
336
  }, [computedSelectValue, multiple, listener, props.fieldName, name, localDatavalue]);
337
- return /* @__PURE__ */ jsx("div", { className: clsx(DEFAULT_CLASS, className), hidden: props.hidden, children: /* @__PURE__ */ jsxs(
337
+ return /* @__PURE__ */ jsx("div", { className: clsx(DEFAULT_CLASS, className), hidden: props.hidden, style: styles, children: /* @__PURE__ */ jsxs(
338
338
  NativeSelect,
339
339
  __spreadProps(__spreadValues({
340
340
  name,
@@ -367,8 +367,7 @@ const WmSelect = React.memo(
367
367
  "aria-readonly": readonly,
368
368
  className: `app-select ${className} ${DEFAULT_CLASS} form-control ng-valid ng-touched ng-dirty wm-app `,
369
369
  accessKey: shortcutkey,
370
- title: hint,
371
- style: styles
370
+ title: hint
372
371
  },
373
372
  readOnly: readonly,
374
373
  children: [
@@ -369,13 +369,14 @@ const WmText = memo(
369
369
  autoFocus: autofocus,
370
370
  disabled,
371
371
  required,
372
- placeholder: placeholder != null ? placeholder : "Enter text",
372
+ placeholder: placeholder != null ? placeholder : "Enter value",
373
373
  value: sanitizeInputValue(displayValue),
374
374
  type,
375
375
  inputRef: ref,
376
376
  error: displayError,
377
377
  "aria-readonly": readonly,
378
378
  helperText: supportingtext || void 0,
379
+ style: styles,
379
380
  className: clsx(
380
381
  "app-input-wrapper",
381
382
  isTouched ? "ng-touched" : "ng-untouched",
@@ -443,7 +444,6 @@ const WmText = memo(
443
444
  isTouched ? "ng-touched" : "ng-untouched",
444
445
  displayError && "ng-invalid"
445
446
  ),
446
- style: styles,
447
447
  "aria-label": arialabel,
448
448
  maxLength: maxchars,
449
449
  pattern: regexp,
@@ -14,6 +14,18 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
17
29
  import { Fragment, jsx } from "react/jsx-runtime";
18
30
  import { memo, useEffect, useRef, useState, useCallback, useMemo } from "react";
19
31
  import clsx from "clsx";
@@ -133,13 +145,22 @@ const WmTextarea = memo(
133
145
  }
134
146
  }
135
147
  }, [datavalue, isDirty, validateInput]);
148
+ useEffect(() => {
149
+ var _a2, _b;
150
+ const shadowTextarea = (_b = (_a2 = textareaRef.current) == null ? void 0 : _a2.closest(".wm-textarea-root")) == null ? void 0 : _b.querySelector('textarea[aria-hidden="true"]');
151
+ if (readonly) {
152
+ shadowTextarea == null ? void 0 : shadowTextarea.setAttribute("readonly", "");
153
+ } else {
154
+ shadowTextarea == null ? void 0 : shadowTextarea.removeAttribute("readonly");
155
+ }
156
+ }, [readonly]);
136
157
  useEffect(() => {
137
158
  if (!shortcutkey) return;
138
159
  const handleGlobalKeyDown = (e) => {
139
- var _a;
160
+ var _a2;
140
161
  if (e.altKey && e.key.toLowerCase() === shortcutkey.toLowerCase()) {
141
162
  e.preventDefault();
142
- (_a = textareaRef.current) == null ? void 0 : _a.focus();
163
+ (_a2 = textareaRef.current) == null ? void 0 : _a2.focus();
143
164
  }
144
165
  };
145
166
  window.addEventListener("keydown", handleGlobalKeyDown);
@@ -154,11 +175,11 @@ const WmTextarea = memo(
154
175
  [limitdisplaytext, maxchars, debouncedCharLengthUpdate]
155
176
  );
156
177
  const characterCountText = useMemo(
157
- () => maxchars ? resolveCharacterCountText(maxchars, displayValue, limitdisplaytext) : void 0,
178
+ () => maxchars && limitdisplaytext ? resolveCharacterCountText(maxchars, displayValue, limitdisplaytext) : void 0,
158
179
  [maxchars, displayValue, limitdisplaytext]
159
180
  );
160
181
  const handleInputChange = useCallback((event) => {
161
- var _a;
182
+ var _a2;
162
183
  const newValue = event.target.value;
163
184
  valueRef.current = newValue;
164
185
  setDisplayValue(newValue);
@@ -168,7 +189,7 @@ const WmTextarea = memo(
168
189
  debouncedUpdate(newValue);
169
190
  }
170
191
  if (onKeypress) {
171
- onKeypress(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
192
+ onKeypress(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
172
193
  }
173
194
  setTimeout(() => {
174
195
  isInternalUpdate.current = false;
@@ -176,7 +197,7 @@ const WmTextarea = memo(
176
197
  }, []);
177
198
  const handleBlur = useCallback(
178
199
  (event) => {
179
- var _a;
200
+ var _a2;
180
201
  if (readonly || disabled) {
181
202
  return;
182
203
  }
@@ -194,7 +215,7 @@ const WmTextarea = memo(
194
215
  setIsDirty(false);
195
216
  }
196
217
  if (onBlur) {
197
- onBlur(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
218
+ onBlur(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
198
219
  }
199
220
  setTimeout(() => {
200
221
  isInternalUpdate.current = false;
@@ -204,9 +225,9 @@ const WmTextarea = memo(
204
225
  );
205
226
  const handleFocus = useCallback(
206
227
  (event) => {
207
- var _a;
228
+ var _a2;
208
229
  if (onFocus) {
209
- onFocus(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
230
+ onFocus(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
210
231
  }
211
232
  },
212
233
  [onFocus, listener, name]
@@ -219,8 +240,8 @@ const WmTextarea = memo(
219
240
  }
220
241
  if (onKeydown) {
221
242
  delay(() => {
222
- var _a;
223
- onKeydown(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
243
+ var _a2;
244
+ onKeydown(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
224
245
  }, 0);
225
246
  }
226
247
  },
@@ -230,8 +251,8 @@ const WmTextarea = memo(
230
251
  (event) => {
231
252
  if (onKeyup) {
232
253
  delay(() => {
233
- var _a;
234
- onKeyup(event, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
254
+ var _a2;
255
+ onKeyup(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
235
256
  }, 0);
236
257
  }
237
258
  },
@@ -256,6 +277,8 @@ const WmTextarea = memo(
256
277
  } : {});
257
278
  const value = sanitizeInputValue(displayValue);
258
279
  const isEditable = !readonly && !disabled;
280
+ const _a = styles || {}, { height: styleHeight } = _a, rootStyles = __objRest(_a, ["height"]);
281
+ const textareaHeight = !styleHeight ? void 0 : typeof styleHeight === "number" ? `${styleHeight}px` : String(styleHeight);
259
282
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
260
283
  TextField,
261
284
  __spreadValues({
@@ -276,7 +299,7 @@ const WmTextarea = memo(
276
299
  isTouched ? "ng-touched" : "ng-untouched",
277
300
  isDirty && "ng-invalid"
278
301
  ),
279
- style: styles,
302
+ style: rootStyles,
280
303
  "aria-readonly": readonly,
281
304
  helperText: characterCountText,
282
305
  slotProps: {
@@ -299,7 +322,7 @@ const WmTextarea = memo(
299
322
  isDirty && "ng-invalid",
300
323
  isEditable ? "wm-textarea-editable" : ""
301
324
  ),
302
- style: __spreadValues({}, styles.height ? { "--wm-textarea-height": `${styles.height}` } : {}),
325
+ style: __spreadValues({}, textareaHeight ? { "--wm-textarea-height": textareaHeight } : {}),
303
326
  pattern: regexp
304
327
  }
305
328
  },
@@ -320,7 +343,9 @@ const WmTextarea = memo(
320
343
  "autofocus",
321
344
  "arialabel",
322
345
  "limitdisplaytext",
323
- "hidden"
346
+ "hidden",
347
+ "styles",
348
+ "className"
324
349
  ];
325
350
  return keys.every((key) => prev[key] === current[key]);
326
351
  }
@@ -61,14 +61,19 @@ const WmNav = memo(
61
61
  }, [dataset, orderby]);
62
62
  const triggerActionClickForAnchor = (e, item) => {
63
63
  e == null ? void 0 : e.preventDefault();
64
+ const navigate = () => {
65
+ triggerItemAction({
66
+ label: getItemLabel(item),
67
+ link: item[props.itemlink || "link"],
68
+ target: item[props.itemtarget]
69
+ });
70
+ };
64
71
  if (props.onSelect) {
65
72
  props.onSelect(e, props, item);
73
+ setTimeout(navigate, 0);
74
+ } else {
75
+ navigate();
66
76
  }
67
- triggerItemAction({
68
- label: getItemLabel(item),
69
- link: item[props.itemlink || "link"],
70
- target: item[props.itemtarget]
71
- });
72
77
  };
73
78
  const getItemLabel = (item) => {
74
79
  const { itemlabel } = props;
@@ -3,6 +3,7 @@ import clsx from "clsx";
3
3
  import Link from "next/link";
4
4
  import withDatasetAwareNavigation from "../../../higherOrder/DataNav";
5
5
  import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
6
+ import { WmAppIcon } from "../../common/WmAppIcon";
6
7
  const BreadCrumb = (props) => {
7
8
  const { className, onBeforenavigate, itemtarget, navNodes = [] } = props;
8
9
  function handleBeforeNavigate(e, node) {
@@ -11,7 +12,7 @@ const BreadCrumb = (props) => {
11
12
  }
12
13
  }
13
14
  const renderNavItem = (node, index, isLast = false) => /* @__PURE__ */ jsx("li", { className: clsx(node.class, { active: isLast }), children: /* @__PURE__ */ jsxs(Fragment, { children: [
14
- node.icon ? /* @__PURE__ */ jsx("i", { className: node.icon }) : /* @__PURE__ */ jsx("i", {}),
15
+ node.icon && /* @__PURE__ */ jsx(WmAppIcon, { icon: node.icon }),
15
16
  !isLast ? /* @__PURE__ */ jsx(
16
17
  Link,
17
18
  {
@@ -18,7 +18,15 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
- import { useRef, useState, useEffect, useMemo, Suspense, useCallback, useLayoutEffect } from "react";
21
+ import {
22
+ useRef,
23
+ useState,
24
+ useEffect,
25
+ useMemo,
26
+ Suspense,
27
+ useCallback,
28
+ useLayoutEffect
29
+ } from "react";
22
30
  import clsx from "clsx";
23
31
  import debounce from "lodash-es/debounce";
24
32
  import Popover from "@mui/material/Popover";
@@ -1,25 +1,45 @@
1
1
  "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2
21
  import { jsx } from "react/jsx-runtime";
3
22
  import clsx from "clsx";
4
23
  import { useAppState } from "../../../context/WidgetProvider";
5
24
  import { getCurrentPath } from "../../../core/util/utils";
6
25
  const DEFAULT_CLASS = "app-page-content app-content-column";
7
26
  function WmPageContent(props) {
8
- const { className, columnwidth, styles, layoutClassName } = props;
27
+ const { className, columnwidth, styles, layoutClassName, direction } = props;
9
28
  const appState = useAppState();
10
29
  const pageName = ((appState == null ? void 0 : appState.componentName) || (appState == null ? void 0 : appState.name) || getCurrentPath().split("/").pop() || "").toLowerCase();
11
30
  return /* @__PURE__ */ jsx("div", { className: "app-content-column-wrapper", children: /* @__PURE__ */ jsx("div", { className: clsx(pageName && `app-page-${pageName}`), style: { display: "inline" }, children: /* @__PURE__ */ jsx(
12
31
  "div",
13
- {
32
+ __spreadProps(__spreadValues({
14
33
  style: styles,
15
34
  className: clsx(
16
35
  DEFAULT_CLASS,
17
36
  className,
18
37
  `col-sm-${columnwidth} col-md-${columnwidth}`,
19
38
  layoutClassName
20
- ),
39
+ )
40
+ }, direction ? { direction } : {}), {
21
41
  children: props.children
22
- }
42
+ })
23
43
  ) }) });
24
44
  }
25
45
  WmPageContent.displayName = "WmPageContent";
@@ -9,6 +9,7 @@ export interface PageContentProps {
9
9
  * Utility layout classes from Studio Auto Layout (merged on the page-content root).
10
10
  */
11
11
  layoutClassName?: string;
12
+ direction?: string;
12
13
  }
13
14
  /**
14
15
  * Combined props for the WmPageContent component, including base WaveMaker props.
@@ -70,7 +70,7 @@ const CodegenPartialContainer = memo((props) => {
70
70
  const partial = partials.find((p) => p.name === content);
71
71
  return partial ? React.createElement(partial.component, __spreadProps(__spreadValues({}, params), { onLoad: handleOnLoad })) : null;
72
72
  };
73
- return /* @__PURE__ */ jsx("div", { className: clsx(content && `app-partial-${content.toLowerCase()}`), children: /* @__PURE__ */ jsx(Container, { className: "partial-container", children: contentToRender() }) });
73
+ return /* @__PURE__ */ jsx("div", { className: clsx(content && `app-partial-${content.toLowerCase()}`), children: /* @__PURE__ */ jsx(Container, { className: "partial-container", style: { height: "inherit" }, children: contentToRender() }) });
74
74
  }, arePropsEqual);
75
75
  CodegenPartialContainer.displayName = "WmPartialContainer";
76
76
  const WmPartialContainer = memo((props) => {
@@ -0,0 +1,8 @@
1
+ import { BaseProps } from "@wavemaker-ai/react-runtime/higherOrder/props";
2
+ type WmxRendererProps = {
3
+ componentname: string;
4
+ field?: boolean;
5
+ };
6
+ type WmxRendererExtendedProps = WmxRendererProps & BaseProps;
7
+ declare const WmxRenderer: (props: WmxRendererExtendedProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default WmxRenderer;
@@ -0,0 +1,57 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
29
+ import { jsx } from "react/jsx-runtime";
30
+ import { useMemo } from "react";
31
+ import { getWmxModule } from "../../utils/wmx.utils";
32
+ import withFormController from "../data/form/form-controller/withFormController";
33
+ import withBaseWrapper from "../../higherOrder/withBaseWrapper";
34
+ const WmxRenderer = (props) => {
35
+ var _b;
36
+ const _a = props, { componentname, field } = _a, restProps = __objRest(_a, ["componentname", "field"]);
37
+ const wmxModule = getWmxModule();
38
+ const RawComponent = (_b = wmxModule == null ? void 0 : wmxModule[`Wmx${componentname}`]) != null ? _b : null;
39
+ const FormFieldComponent = useMemo(
40
+ () => RawComponent ? withBaseWrapper(withFormController(RawComponent)) : null,
41
+ [RawComponent]
42
+ );
43
+ const BaseWrappedComponent = useMemo(
44
+ () => RawComponent ? withBaseWrapper(RawComponent) : null,
45
+ [RawComponent]
46
+ );
47
+ if (!wmxModule || !RawComponent || !FormFieldComponent || !BaseWrappedComponent) return null;
48
+ const isFormField = String(field) === "true";
49
+ if (isFormField) {
50
+ return /* @__PURE__ */ jsx(FormFieldComponent, __spreadValues({ componentname }, restProps));
51
+ }
52
+ return /* @__PURE__ */ jsx(BaseWrappedComponent, __spreadValues({ componentname }, restProps));
53
+ };
54
+ var WmxRenderer_default = WmxRenderer;
55
+ export {
56
+ WmxRenderer_default as default
57
+ };
package/core/appstore.js CHANGED
@@ -43,7 +43,7 @@ const appstore = {
43
43
  };
44
44
  if (!appstore.I18nService.get()) {
45
45
  appstore.I18nService.set({
46
- selectedLocale: getSessionLocaleSafe() || "en",
46
+ selectedLocale: "en",
47
47
  messages: {},
48
48
  getSelectedLocale: function() {
49
49
  try {
@@ -38,8 +38,6 @@ export declare const getSessionStorageItem: (key: string) => any;
38
38
  export declare const getSessionLocaleSafe: () => string | undefined;
39
39
  export declare const getTimezone: () => string;
40
40
  export declare const formatMessage: (fragment: any, expression: string) => any;
41
- /** Angular parity: same appLocale object, swap message keys in place so bindings stay valid. */
42
- export declare function syncLocaleMessages(target: Record<string, any> | undefined, messages: Record<string, any>): boolean;
43
41
  export declare function reload(): void;
44
42
  export declare const toNumber: (value: any) => number;
45
43
  export declare const _get: {
@@ -93,34 +93,6 @@ const formatMessage = (fragment, expression) => {
93
93
  const path = `appLocale.${expression}`;
94
94
  return has(fragment, path) ? get(fragment, path) : void 0;
95
95
  };
96
- function syncLocaleMessages(target, messages) {
97
- if (!target || typeof target !== "object") {
98
- return false;
99
- }
100
- let synced = true;
101
- Object.keys(target).forEach((key) => {
102
- if (!(key in messages)) {
103
- try {
104
- delete target[key];
105
- } catch (e) {
106
- synced = false;
107
- }
108
- }
109
- });
110
- Object.keys(messages).forEach((key) => {
111
- try {
112
- const descriptor = Object.getOwnPropertyDescriptor(target, key);
113
- if (descriptor && !descriptor.configurable && !descriptor.writable) {
114
- synced = false;
115
- return;
116
- }
117
- target[key] = messages[key];
118
- } catch (e) {
119
- synced = false;
120
- }
121
- });
122
- return synced;
123
- }
124
96
  function reload() {
125
97
  window.location.reload();
126
98
  }
@@ -216,7 +188,6 @@ export {
216
188
  reload,
217
189
  replace,
218
190
  setSessionStorageItem,
219
- syncLocaleMessages,
220
191
  toBoolean,
221
192
  toNumber
222
193
  };