@wavemaker-ai/react-runtime 1.0.0-rc.647712 → 12.0.0-rc.647733

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 (106) hide show
  1. package/components/basic/richtexteditor/index.d.ts +1 -0
  2. package/components/basic/search/index.js +5 -4
  3. package/components/basic/search/utils.d.ts +1 -0
  4. package/components/basic/search/utils.js +9 -0
  5. package/components/common/index.d.ts +2 -0
  6. package/components/common/index.js +2 -0
  7. package/components/common/partial-content-wrapper.d.ts +15 -0
  8. package/components/common/partial-content-wrapper.js +11 -0
  9. package/components/container/index.js +5 -2
  10. package/components/container/tabs/index.js +5 -3
  11. package/components/container/wizard/index.js +36 -3
  12. package/components/container/wizard/props.d.ts +2 -2
  13. package/components/data/form/dynamic-fields/WmxDynamicFormField.js +9 -23
  14. package/components/data/form/form-controller/props.d.ts +2 -0
  15. package/components/data/form/form-controller/utils.js +3 -2
  16. package/components/data/form/form-controller/validation-contrustor.js +112 -1
  17. package/components/data/form/form-controller/withFormController.js +1 -1
  18. package/components/data/form/form-field/index.js +6 -3
  19. package/components/data/form/form-field/props.d.ts +1 -0
  20. package/components/data/list/components/ListItemWithTemplate.js +1 -1
  21. package/components/data/list/index.js +1 -1
  22. package/components/data/table/components/EditableCell.js +47 -24
  23. package/components/data/table/components/FieldValidationError.js +1 -1
  24. package/components/data/table/components/TableHeader.js +9 -3
  25. package/components/data/table/hooks/useFormWidget.js +11 -0
  26. package/components/data/table/hooks/useRowSelection.js +58 -1
  27. package/components/data/table/hooks/useTableEdit.d.ts +1 -1
  28. package/components/data/table/hooks/useTableEdit.js +115 -75
  29. package/components/data/table/hooks/useTableEditForms.d.ts +25 -0
  30. package/components/data/table/hooks/useTableEditForms.js +30 -0
  31. package/components/data/table/index.js +68 -32
  32. package/components/data/table/props.d.ts +42 -23
  33. package/components/data/table/utils/buildSelectionColumns.js +3 -3
  34. package/components/data/table/utils/columnProxy.d.ts +7 -1
  35. package/components/data/table/utils/columnProxy.js +21 -1
  36. package/components/data/table/utils/columnValidation.d.ts +19 -0
  37. package/components/data/table/utils/columnValidation.js +76 -0
  38. package/components/data/table/utils/constants.d.ts +2 -0
  39. package/components/data/table/utils/constants.js +2 -0
  40. package/components/data/table/utils/index.d.ts +4 -12
  41. package/components/data/table/utils/index.js +13 -77
  42. package/components/data/table/utils/selectionUtils.js +13 -5
  43. package/components/input/chips/index.d.ts +1 -0
  44. package/components/input/color-picker/index.d.ts +1 -0
  45. package/components/input/currency/index.d.ts +1 -0
  46. package/components/input/default/checkbox/index.d.ts +1 -0
  47. package/components/input/default/checkboxset/index.d.ts +1 -0
  48. package/components/input/default/radioset/index.d.ts +1 -0
  49. package/components/input/default/switch/index.d.ts +1 -0
  50. package/components/input/epoch/datetime/index.js +10 -2
  51. package/components/input/number/index.d.ts +1 -0
  52. package/components/input/rating/index.d.ts +1 -0
  53. package/components/input/select/index.d.ts +1 -0
  54. package/components/input/slider/index.d.ts +1 -0
  55. package/components/input/text/index.d.ts +1 -0
  56. package/components/input/textarea/index.d.ts +1 -0
  57. package/components/input/upload/index.d.ts +1 -0
  58. package/components/layout/footer/index.js +4 -2
  59. package/components/layout/footer/props.d.ts +1 -0
  60. package/components/layout/header/index.js +29 -3
  61. package/components/layout/header/props.d.ts +1 -0
  62. package/components/layout/leftnav/index.js +22 -6
  63. package/components/layout/leftnav/props.d.ts +1 -0
  64. package/components/layout/leftnav/utils/page-class-util.d.ts +1 -0
  65. package/components/layout/leftnav/utils/page-class-util.js +4 -3
  66. package/components/layout/rightnav/index.js +4 -2
  67. package/components/layout/rightnav/props.d.ts +1 -0
  68. package/components/layout/topnav/index.js +4 -2
  69. package/components/layout/topnav/props.d.ts +1 -0
  70. package/components/navbar/index.js +32 -7
  71. package/components/navigation/menu/index.js +6 -2
  72. package/components/page/index.js +60 -19
  73. package/components/page/page-context.d.ts +4 -0
  74. package/core/proxy-service.js +86 -19
  75. package/higherOrder/BaseApp.js +1 -1
  76. package/higherOrder/BasePage.js +2 -1
  77. package/higherOrder/withBaseWrapper.js +10 -2
  78. package/hooks/useHttp.d.ts +14 -4
  79. package/hooks/useHttp.js +47 -9
  80. package/package-lock.json +316 -310
  81. package/package.json +3 -3
  82. package/runtime-dynamic/App.js +21 -2
  83. package/runtime-dynamic/app-initializer.js +8 -1
  84. package/runtime-dynamic/factories/dynamic-component.js +4 -3
  85. package/runtime-dynamic/main.d.ts +1 -0
  86. package/runtime-dynamic/main.js +9 -1
  87. package/runtime-dynamic/services/compile-render.js +7 -0
  88. package/runtime-dynamic/services/css-scoping.d.ts +1 -1
  89. package/runtime-dynamic/services/css-scoping.js +2 -2
  90. package/runtime-dynamic/services/variable-factory.js +2 -1
  91. package/runtime-dynamic/services/variable-transpiler.js +4 -1
  92. package/runtime-dynamic/wmx-shared.d.ts +40 -0
  93. package/runtime-dynamic/wmx-shared.js +33 -0
  94. package/utils/style-utils.js +1 -1
  95. package/utils/wmx.utils.d.ts +0 -1
  96. package/utils/wmx.utils.js +0 -25
  97. package/variables/crud-variable.d.ts +10 -0
  98. package/variables/crud-variable.js +53 -2
  99. package/variables/live-variable.d.ts +1 -0
  100. package/variables/live-variable.js +2 -1
  101. package/variables/operation-params.d.ts +29 -0
  102. package/variables/operation-params.js +69 -0
  103. package/variables/service-variable.d.ts +9 -0
  104. package/variables/service-variable.js +21 -2
  105. package/components/data/table/utils/validation.d.ts +0 -13
  106. package/components/data/table/utils/validation.js +0 -82
@@ -18,15 +18,12 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import {
21
- forEach,
22
- entries,
23
21
  size,
24
22
  isEmpty,
25
23
  isArray,
26
24
  map,
27
25
  get,
28
26
  trim,
29
- startsWith,
30
27
  findIndex,
31
28
  assign,
32
29
  floor,
@@ -409,74 +406,6 @@ const getActionButtonClass = (action) => {
409
406
  const getTableActionButtonClass = (action) => {
410
407
  return `btn ${get(action, "className", "btn-primary")} ${isAddNewAction(get(action, "key")) ? "add-action" : ""}`;
411
408
  };
412
- const validateEditingFields = (fieldRefs, editingRowId) => {
413
- const invalidElements = [];
414
- const invalidFieldKeys = [];
415
- const shouldValidateField = (fieldKey) => {
416
- if (!editingRowId) return true;
417
- return startsWith(fieldKey, `${editingRowId}_`);
418
- };
419
- forEach(entries(fieldRefs), ([fieldKey, fieldElement]) => {
420
- if (!shouldValidateField(fieldKey) || !fieldElement) {
421
- return;
422
- }
423
- let isInvalid = false;
424
- const inputs = fieldElement.querySelectorAll("input, select, textarea");
425
- forEach(inputs, (input) => {
426
- if (input && !input.validity.valid && input.hasAttribute("required")) {
427
- invalidElements.push(input);
428
- isInvalid = true;
429
- }
430
- if (input && input.classList.contains("ng-invalid")) {
431
- invalidElements.push(input);
432
- isInvalid = true;
433
- }
434
- if (input && input.hasAttribute("required") && !trim(input.value)) {
435
- invalidElements.push(input);
436
- isInvalid = true;
437
- }
438
- });
439
- if (fieldElement.hasAttribute("required")) {
440
- const inputEl = fieldElement.querySelector("input, textarea, select");
441
- if (inputEl && !trim(inputEl.value)) {
442
- invalidElements.push(inputEl);
443
- isInvalid = true;
444
- }
445
- }
446
- if (isInvalid) {
447
- invalidFieldKeys.push(fieldKey);
448
- }
449
- });
450
- if (size(invalidElements) > 0) {
451
- const logPrefix = editingRowId ? `[${editingRowId}]` : "[Validation]";
452
- console.log(`${logPrefix} Validation failed: Found ${size(invalidElements)} invalid elements`);
453
- const firstInvalidElement = get(invalidElements, "[0]");
454
- if (firstInvalidElement) {
455
- const cell = firstInvalidElement.closest("td, .app-datagrid-cell, .form-field");
456
- if (cell) {
457
- const focusTarget = cell.querySelector(
458
- "[focus-target], input, textarea, select"
459
- );
460
- if (focusTarget) {
461
- setTimeout(() => {
462
- focusTarget.focus();
463
- console.log(`${logPrefix} Focused first invalid field:`, focusTarget);
464
- }, 0);
465
- }
466
- } else {
467
- setTimeout(() => {
468
- firstInvalidElement.focus();
469
- }, 0);
470
- }
471
- }
472
- }
473
- return {
474
- isValid: isEmpty(invalidElements),
475
- invalidElements,
476
- invalidFieldKeys,
477
- firstInvalidElement: size(invalidElements) > 0 ? get(invalidElements, "[0]") : void 0
478
- };
479
- };
480
409
  const getButtonClasses = (action, spacing = "normal", isGridEditMode = false, isLoading = false) => {
481
410
  const baseClass = `btn ${get(action, "className", "btn-primary")} ${isAddNewAction(get(action, "key")) ? "add-action" : ""}`;
482
411
  const spacingClass = spacing === "condensed" ? "btn-sm" : "";
@@ -659,11 +588,17 @@ import {
659
588
  INTERACTIVE_ROLES,
660
589
  INTERACTIVE_DATA_ROLES,
661
590
  INTERACTIVE_TAG_NAMES,
591
+ SELECTION_COLUMN_DATA_ROLES,
662
592
  UNSUPPORTED_STATE_PERSISTENCE_TYPES
663
593
  } from "./constants";
664
594
  import { renderDisplayCell } from "./renderDisplayCell";
665
595
  import { buildSelectionColumns } from "./buildSelectionColumns";
666
- import { validateField, resetValidationState, updateValidationErrors } from "./validation";
596
+ import {
597
+ cloneValidators,
598
+ collectNativeValidityErrors,
599
+ focusFirstInvalidCell,
600
+ isColumnValidatable
601
+ } from "./columnValidation";
667
602
  import {
668
603
  hasInteractiveClass,
669
604
  hasInteractiveAttributes,
@@ -694,6 +629,7 @@ export {
694
629
  INTERACTIVE_ROLES,
695
630
  INTERACTIVE_TAG_NAMES,
696
631
  INTERNAL_PROPERTIES,
632
+ SELECTION_COLUMN_DATA_ROLES,
697
633
  TABLE_CSS_CLASSES2 as TABLE_CSS_CLASSES,
698
634
  TABLE_DATA_STATES,
699
635
  TABLE_MESSAGES,
@@ -702,6 +638,8 @@ export {
702
638
  buildSelectionColumns,
703
639
  cleanRowData,
704
640
  clearTableState,
641
+ cloneValidators,
642
+ collectNativeValidityErrors,
705
643
  convertFilterArrayToObject,
706
644
  convertFilterObjectToArray,
707
645
  createDataColumn,
@@ -712,6 +650,7 @@ export {
712
650
  distributeColumnWidths,
713
651
  extractDataArray,
714
652
  flattenTableStructure,
653
+ focusFirstInvalidCell,
715
654
  getActionButtonClass,
716
655
  getActionColumnSize,
717
656
  getAggregateFunctions,
@@ -733,6 +672,7 @@ export {
733
672
  hasInteractiveClass,
734
673
  isAddNewAction,
735
674
  isColumnDomHidden,
675
+ isColumnValidatable,
736
676
  isColumnVisibleForViewport,
737
677
  isDataColumn,
738
678
  isDeleteAction,
@@ -746,13 +686,9 @@ export {
746
686
  parseTableStructureWithGroups,
747
687
  parseWidth,
748
688
  renderDisplayCell,
749
- resetValidationState,
750
689
  rowExistsInDataset,
751
690
  saveTableState,
752
691
  selectionStateHelpers,
753
692
  shouldShowPagination,
754
- shouldShowPanelHeading,
755
- updateValidationErrors,
756
- validateEditingFields,
757
- validateField
693
+ shouldShowPanelHeading
758
694
  };
@@ -3,7 +3,8 @@ import {
3
3
  INTERACTIVE_CLASSES,
4
4
  INTERACTIVE_ROLES,
5
5
  INTERACTIVE_DATA_ROLES,
6
- INTERACTIVE_TAG_NAMES
6
+ INTERACTIVE_TAG_NAMES,
7
+ SELECTION_COLUMN_DATA_ROLES
7
8
  } from "./constants";
8
9
  const hasInteractiveClass = (element) => {
9
10
  if (!element.className || typeof element.className !== "string") return false;
@@ -24,9 +25,12 @@ const hasInteractiveAttributes = (element) => {
24
25
  return true;
25
26
  }
26
27
  const dataRole = element.getAttribute("data-role");
28
+ if (dataRole && SELECTION_COLUMN_DATA_ROLES.includes(dataRole)) {
29
+ return false;
30
+ }
27
31
  if (dataRole) {
28
32
  for (const interactiveRole of INTERACTIVE_DATA_ROLES) {
29
- if (dataRole.includes(interactiveRole)) {
33
+ if (dataRole === interactiveRole) {
30
34
  return true;
31
35
  }
32
36
  }
@@ -41,14 +45,18 @@ const isSelectionCheckboxRenamed = (event) => {
41
45
  const checkbox = (_b = row == null ? void 0 : row.querySelector) == null ? void 0 : _b.call(row, 'input[type="checkbox"]');
42
46
  return !!checkbox && checkbox.getAttribute("name") !== MULTI_SELECT_INPUT_NAME;
43
47
  };
48
+ const isSelectionColumnTarget = (target) => {
49
+ if (!(target == null ? void 0 : target.closest)) return false;
50
+ return SELECTION_COLUMN_DATA_ROLES.some((role) => target.closest(`[data-role="${role}"]`));
51
+ };
44
52
  const isInteractiveElement = (event) => {
45
53
  const target = event.target;
46
- if (INTERACTIVE_TAG_NAMES.includes(target.tagName)) {
47
- return true;
54
+ if (isSelectionColumnTarget(target)) {
55
+ return false;
48
56
  }
49
57
  let element = target;
50
58
  while (element) {
51
- if (hasInteractiveClass(element) || hasInteractiveAttributes(element)) {
59
+ if (INTERACTIVE_TAG_NAMES.includes(element.tagName) || hasInteractiveClass(element) || hasInteractiveAttributes(element)) {
52
60
  return true;
53
61
  }
54
62
  element = element.parentElement;
@@ -119,6 +119,7 @@ declare const _default: React.ComponentType<{
119
119
  standalone?: boolean;
120
120
  formRef?: any;
121
121
  formKey?: string;
122
+ hideValidationMessage?: boolean;
122
123
  name: string;
123
124
  datavalue?: any;
124
125
  defaultvalue?: any;
@@ -82,6 +82,7 @@ declare const _default: React.ComponentType<{
82
82
  standalone?: boolean;
83
83
  formRef?: any;
84
84
  formKey?: string;
85
+ hideValidationMessage?: boolean;
85
86
  name: string;
86
87
  datavalue: any;
87
88
  defaultvalue?: any;
@@ -93,6 +93,7 @@ declare const _default: React.ComponentType<{
93
93
  standalone?: boolean;
94
94
  formRef?: any;
95
95
  formKey?: string;
96
+ hideValidationMessage?: boolean;
96
97
  name: string;
97
98
  datavalue?: any;
98
99
  defaultvalue?: any;
@@ -84,6 +84,7 @@ declare const _default: React.ComponentType<{
84
84
  standalone?: boolean;
85
85
  formRef?: any;
86
86
  formKey?: string;
87
+ hideValidationMessage?: boolean;
87
88
  name: string;
88
89
  datavalue?: any;
89
90
  defaultvalue?: any;
@@ -104,6 +104,7 @@ declare const _default: React.ComponentType<{
104
104
  standalone?: boolean;
105
105
  formRef?: any;
106
106
  formKey?: string;
107
+ hideValidationMessage?: boolean;
107
108
  name: string;
108
109
  datavalue?: any;
109
110
  defaultvalue?: any;
@@ -99,6 +99,7 @@ declare const _default: React.ComponentType<{
99
99
  standalone?: boolean;
100
100
  formRef?: any;
101
101
  formKey?: string;
102
+ hideValidationMessage?: boolean;
102
103
  name: string;
103
104
  datavalue?: any;
104
105
  defaultvalue?: any;
@@ -96,6 +96,7 @@ declare const _default: React.ComponentType<{
96
96
  standalone?: boolean;
97
97
  formRef?: any;
98
98
  formKey?: string;
99
+ hideValidationMessage?: boolean;
99
100
  name: string;
100
101
  datavalue?: any;
101
102
  defaultvalue?: any;
@@ -122,9 +122,11 @@ const WmDateTime = memo(
122
122
  const [datePickerView, setDatePickerView] = useState("day");
123
123
  const [isCurrentMonth, setIsCurrentMonth] = useState(true);
124
124
  const [validationFailureMessage, setValidationFailureMessage] = useState("");
125
+ const [isDirty, setIsDirty] = useState(false);
125
126
  const inputRef = useRef(null);
126
127
  const onBeforeloadExecutedRef = useRef(false);
127
128
  const anchorRef = useRef(null);
129
+ const showValidationError = isDirty && Boolean(validationFailureMessage || invalidFormat || dateNotInRange);
128
130
  const isReadOnly = useMemo(
129
131
  () => readonly || isCurrentDate || dataentrymode !== "undefined" && dataentrymode !== "default",
130
132
  [readonly, dataentrymode, isCurrentDate]
@@ -241,6 +243,7 @@ const WmDateTime = memo(
241
243
  );
242
244
  const handleDateSelection = useCallback(
243
245
  (date) => {
246
+ setIsDirty(true);
244
247
  if (!date) {
245
248
  handleFinalDateChange(null);
246
249
  setIsDateOpen(false);
@@ -300,6 +303,7 @@ const WmDateTime = memo(
300
303
  }, []);
301
304
  const handleTimeSelection = useCallback(
302
305
  (time) => {
306
+ setIsDirty(true);
303
307
  if (!time || !tempDateValue) return;
304
308
  const combinedDateTime = moment(tempDateValue).hour(moment(time).hour()).minute(moment(time).minute()).second(moment(time).second()).toDate();
305
309
  setLocalDateValue(combinedDateTime);
@@ -328,6 +332,7 @@ const WmDateTime = memo(
328
332
  (event) => {
329
333
  var _a2, _b2;
330
334
  if (dataentrymode === "picker") return;
335
+ setIsDirty(true);
331
336
  const value = event.target.value;
332
337
  setDisplayValue(value);
333
338
  if (!value) {
@@ -433,11 +438,13 @@ const WmDateTime = memo(
433
438
  [excludedDaysArray, excludedDatesArray]
434
439
  );
435
440
  const handleToday = useCallback(() => {
441
+ setIsDirty(true);
436
442
  const today = moment().toDate();
437
443
  handleFinalDateChange(today);
438
444
  setIsTimeOpen(true);
439
445
  }, [handleFinalDateChange]);
440
446
  const handleClear = useCallback(() => {
447
+ setIsDirty(true);
441
448
  handleFinalDateChange(null);
442
449
  }, [handleFinalDateChange]);
443
450
  useEffect(() => {
@@ -565,6 +572,7 @@ const WmDateTime = memo(
565
572
  onBlur: (event) => {
566
573
  var _a2;
567
574
  if (readonly) return;
575
+ setIsDirty(true);
568
576
  onBlur && name && onBlur(event, (_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name]);
569
577
  },
570
578
  onChange: handleInputChange,
@@ -578,8 +586,8 @@ const WmDateTime = memo(
578
586
  },
579
587
  autoFocus: autofocus,
580
588
  required,
581
- error: Boolean(validationFailureMessage || invalidFormat || dateNotInRange),
582
- helperText: validationFailureMessage || (invalidFormat ? validationmessage || "Invalid date format" : dateNotInRange ? validationmessage || "Date not in valid range" : ""),
589
+ error: showValidationError,
590
+ helperText: showValidationError ? validationFailureMessage || (invalidFormat ? validationmessage || "Invalid date format" : dateNotInRange ? validationmessage || "Date not in valid range" : "") : "",
583
591
  InputProps: {
584
592
  readOnly: isReadOnly,
585
593
  placeholder: floatinglabel ? void 0 : placeholder
@@ -89,6 +89,7 @@ declare const _default: React.ComponentType<{
89
89
  standalone?: boolean;
90
90
  formRef?: any;
91
91
  formKey?: string;
92
+ hideValidationMessage?: boolean;
92
93
  name: string;
93
94
  datavalue?: any;
94
95
  defaultvalue?: any;
@@ -113,6 +113,7 @@ declare const _default: React.ComponentType<{
113
113
  standalone?: boolean;
114
114
  formRef?: any;
115
115
  formKey?: string;
116
+ hideValidationMessage?: boolean;
116
117
  name: string;
117
118
  datavalue?: any;
118
119
  defaultvalue?: any;
@@ -92,6 +92,7 @@ declare const _default: React.ComponentType<{
92
92
  standalone?: boolean;
93
93
  formRef?: any;
94
94
  formKey?: string;
95
+ hideValidationMessage?: boolean;
95
96
  name: string;
96
97
  datavalue?: any;
97
98
  defaultvalue?: any;
@@ -89,6 +89,7 @@ declare const _default: React.ComponentType<{
89
89
  standalone?: boolean;
90
90
  formRef?: any;
91
91
  formKey?: string;
92
+ hideValidationMessage?: boolean;
92
93
  name: string;
93
94
  datavalue?: any;
94
95
  defaultvalue?: any;
@@ -98,6 +98,7 @@ declare const _default: import("react").ComponentType<{
98
98
  standalone?: boolean;
99
99
  formRef?: any;
100
100
  formKey?: string;
101
+ hideValidationMessage?: boolean;
101
102
  name: string;
102
103
  datavalue?: any;
103
104
  defaultvalue?: any;
@@ -83,6 +83,7 @@ declare const _default: React.ComponentType<{
83
83
  standalone?: boolean;
84
84
  formRef?: any;
85
85
  formKey?: string;
86
+ hideValidationMessage?: boolean;
86
87
  name: string;
87
88
  datavalue?: any;
88
89
  defaultvalue?: any;
@@ -78,6 +78,7 @@ declare const _default: React.ComponentType<{
78
78
  standalone?: boolean;
79
79
  formRef?: any;
80
80
  formKey?: string;
81
+ hideValidationMessage?: boolean;
81
82
  name: string;
82
83
  datavalue?: any;
83
84
  defaultvalue?: any;
@@ -1,10 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import { Box } from "@mui/material";
4
+ import { PartialContentWrapper } from "../../common";
4
5
  const DEFAULT_CLASS = "app-footer clearfix";
5
6
  const WmFooter = (props) => {
6
- const { styles, children, render, className, id } = props;
7
- return /* @__PURE__ */ jsx(Box, { component: "div", sx: styles, className: clsx(DEFAULT_CLASS, className), id, children: render ? render(props) : children });
7
+ const { styles, children, render, className, id, content } = props;
8
+ const rendered = render ? render(props) : children;
9
+ return /* @__PURE__ */ jsx(Box, { component: "div", sx: styles, className: clsx(DEFAULT_CLASS, className), id, children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: rendered }) });
8
10
  };
9
11
  WmFooter.displayName = "WmFooter";
10
12
  var footer_default = WmFooter;
@@ -3,6 +3,7 @@ export interface FooterProps {
3
3
  className?: string;
4
4
  styles?: React.CSSProperties;
5
5
  id?: string;
6
+ content?: string;
6
7
  render?: (props: Record<string, any>) => React.ReactNode;
7
8
  }
8
9
  export type WmFooterProps = FooterProps;
@@ -1,10 +1,36 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useContext } from "react";
2
3
  import clsx from "clsx";
3
4
  import Box from "@mui/material/Box";
5
+ import IconButton from "@mui/material/IconButton";
6
+ import { PartialContentWrapper } from "../../common";
7
+ import { PageLayoutContext } from "../../page/page-context";
4
8
  const DEFAULT_CLASS = "app-header clearfix app-header-shrink";
5
9
  const WmHeader = (props) => {
6
- const { styles, children, render, className, id } = props;
7
- return /* @__PURE__ */ jsx(Box, { component: "header", className: clsx(DEFAULT_CLASS, className), id, sx: styles, children: /* @__PURE__ */ jsx(Box, { component: "div", className: "app-header-container", children: render ? render(props) : children }) });
10
+ const { styles, children, render, className, id, content } = props;
11
+ const {
12
+ hasLeftPanel,
13
+ leftPanelExpanded = false,
14
+ toggleLeftPanel
15
+ } = useContext(PageLayoutContext);
16
+ const rendered = render ? render(props) : children;
17
+ const handleLeftNavToggle = (event) => {
18
+ event.stopPropagation();
19
+ toggleLeftPanel == null ? void 0 : toggleLeftPanel();
20
+ };
21
+ return /* @__PURE__ */ jsxs(Box, { component: "header", className: clsx(DEFAULT_CLASS, className), id, sx: styles, children: [
22
+ hasLeftPanel && /* @__PURE__ */ jsx(Box, { component: "div", className: "app-header-menu", "data-role": "page-left-panel-icon", children: /* @__PURE__ */ jsx(
23
+ IconButton,
24
+ {
25
+ className: "app-header-action btn-text",
26
+ "aria-expanded": leftPanelExpanded,
27
+ "aria-label": "Expand Left navigation",
28
+ onClick: handleLeftNavToggle,
29
+ children: /* @__PURE__ */ jsx("i", { className: "wi wi-menu", "aria-hidden": "true" })
30
+ }
31
+ ) }),
32
+ /* @__PURE__ */ jsx(Box, { component: "div", className: "app-header-container", children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: rendered }) })
33
+ ] });
8
34
  };
9
35
  WmHeader.displayName = "WmHeader";
10
36
  var header_default = WmHeader;
@@ -3,6 +3,7 @@ export interface HeaderProps {
3
3
  className?: string;
4
4
  styles?: React.CSSProperties;
5
5
  id?: string;
6
+ content?: string;
6
7
  render?: (props: Record<string, any>) => React.ReactNode;
7
8
  }
8
9
  export type WmHeaderProps = HeaderProps;
@@ -2,12 +2,17 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useContext, useEffect } from "react";
3
3
  import clsx from "clsx";
4
4
  import Box from "@mui/material/Box";
5
+ import { PartialContentWrapper } from "../../common";
5
6
  import { PageLayoutContext } from "../../page/page-context";
6
7
  import { getLeftPanelPageClasses } from "./utils/page-class-util";
7
- const DEFAULT_CLASS = "app-nav-drawer app-left-panel left-panel-collapsed ";
8
+ const DEFAULT_CLASS = "app-nav-drawer app-left-panel";
8
9
  const SLIDE_IN = "slide-in";
9
10
  const WmLeftPanel = (props) => {
10
- const { onLeftPanelPageClassesChange } = useContext(PageLayoutContext);
11
+ const {
12
+ onLeftPanelPageClassesChange,
13
+ onLeftPanelPresenceChange,
14
+ leftPanelExpanded = false
15
+ } = useContext(PageLayoutContext);
11
16
  const {
12
17
  styles,
13
18
  children,
@@ -19,7 +24,8 @@ const WmLeftPanel = (props) => {
19
24
  navtype,
20
25
  navheight,
21
26
  animation = SLIDE_IN,
22
- onNavHeightChange
27
+ onNavHeightChange,
28
+ content
23
29
  } = props;
24
30
  useEffect(() => {
25
31
  if (onNavHeightChange) {
@@ -31,18 +37,27 @@ const WmLeftPanel = (props) => {
31
37
  }
32
38
  };
33
39
  }, [navheight, onNavHeightChange]);
40
+ useEffect(() => {
41
+ onLeftPanelPresenceChange == null ? void 0 : onLeftPanelPresenceChange(true);
42
+ return () => {
43
+ onLeftPanelPresenceChange == null ? void 0 : onLeftPanelPresenceChange(false);
44
+ };
45
+ }, [onLeftPanelPresenceChange]);
34
46
  useEffect(() => {
35
47
  onLeftPanelPageClassesChange == null ? void 0 : onLeftPanelPageClassesChange(
36
48
  getLeftPanelPageClasses({
37
49
  animation,
38
50
  columnwidth,
39
- xscolumnwidth
51
+ xscolumnwidth,
52
+ expanded: leftPanelExpanded
40
53
  })
41
54
  );
55
+ }, [animation, columnwidth, xscolumnwidth, leftPanelExpanded, onLeftPanelPageClassesChange]);
56
+ useEffect(() => {
42
57
  return () => {
43
58
  onLeftPanelPageClassesChange == null ? void 0 : onLeftPanelPageClassesChange(void 0);
44
59
  };
45
- }, [animation, columnwidth, xscolumnwidth]);
60
+ }, [onLeftPanelPageClassesChange]);
46
61
  return /* @__PURE__ */ jsx(
47
62
  Box,
48
63
  {
@@ -51,11 +66,12 @@ const WmLeftPanel = (props) => {
51
66
  sx: styles,
52
67
  className: clsx(
53
68
  DEFAULT_CLASS,
69
+ leftPanelExpanded ? "left-panel-expanded" : "left-panel-collapsed",
54
70
  className,
55
71
  animation,
56
72
  `col-md-${columnwidth} col-sm-${columnwidth} col-xs-${xscolumnwidth} ${navtype ? `app-nav-${navtype}` : ""} ${navheight ? `app-nav-${navheight}` : ""}`
57
73
  ),
58
- children: render ? render(props) : children
74
+ children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: render ? render(props) : children })
59
75
  }
60
76
  );
61
77
  };
@@ -29,6 +29,7 @@ export interface LeftNavProps {
29
29
  className?: string;
30
30
  styles?: React.CSSProperties;
31
31
  id?: string;
32
+ content?: string;
32
33
  render?: (props: Record<string, any>) => React.ReactNode;
33
34
  }
34
35
  export type WmLeftNavProps = LeftNavProps;
@@ -2,6 +2,7 @@ export type LeftPanelPageLayout = {
2
2
  animation?: string;
3
3
  columnwidth?: number | string;
4
4
  xscolumnwidth?: number | string;
5
+ expanded?: boolean;
5
6
  };
6
7
  /**
7
8
  * (slide-in-left-panel-container, left-panel-container-*-*, etc.).
@@ -9,9 +9,10 @@ const getPageWidthClass = (device, panelWidth) => {
9
9
  return `left-panel-container-${device}-${12 - width}`;
10
10
  };
11
11
  const getLeftPanelPageClasses = (layout) => {
12
+ const containerClass = layout.expanded ? "left-panel-expanded-container" : "left-panel-collapsed-container";
12
13
  if (layout.animation === SLIDE_IN) {
13
14
  return clsx(
14
- "left-panel-collapsed-container",
15
+ containerClass,
15
16
  "slide-in-left-panel-container",
16
17
  getPageWidthClass("md", layout.columnwidth),
17
18
  getPageWidthClass("sm", layout.columnwidth),
@@ -19,9 +20,9 @@ const getLeftPanelPageClasses = (layout) => {
19
20
  );
20
21
  }
21
22
  if (layout.animation === SLIDE_OVER) {
22
- return clsx("left-panel-collapsed-container", "slide-over-left-panel-container");
23
+ return clsx(containerClass, "slide-over-left-panel-container");
23
24
  }
24
- return "left-panel-collapsed-container";
25
+ return containerClass;
25
26
  };
26
27
  export {
27
28
  getLeftPanelPageClasses
@@ -1,10 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import Box from "@mui/material/Box";
4
+ import { PartialContentWrapper } from "../../common";
4
5
  const DEFAULT_CLASS = "app-right-panel";
5
6
  const WmRightPanel = (props) => {
6
- const { styles, children, render, className, columnwidth = 2, id } = props;
7
- return /* @__PURE__ */ jsx(Box, { id, sx: styles, className: clsx(DEFAULT_CLASS, className, `col-sm-${columnwidth}`), children: render ? render(props) : children });
7
+ const { styles, children, render, className, columnwidth = 2, id, content } = props;
8
+ const rendered = render ? render(props) : children;
9
+ return /* @__PURE__ */ jsx(Box, { id, sx: styles, className: clsx(DEFAULT_CLASS, className, `col-sm-${columnwidth}`), children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: rendered }) });
8
10
  };
9
11
  WmRightPanel.displayName = "WmRightPanel";
10
12
  var rightnav_default = WmRightPanel;
@@ -8,6 +8,7 @@ export interface RightNavProps {
8
8
  className?: string;
9
9
  styles?: React.CSSProperties;
10
10
  id?: string;
11
+ content?: string;
11
12
  render?: (props: Record<string, any>) => React.ReactNode;
12
13
  }
13
14
  export type WmRightNavProps = RightNavProps;
@@ -1,9 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import Box from "@mui/material/Box";
4
+ import { PartialContentWrapper } from "../../common";
4
5
  const DEFAULT_CLASS = "app-top-nav";
5
6
  const WmTopNav = (props) => {
6
- const { styles, children, render, className, id } = props;
7
+ const { styles, children, render, className, id, content } = props;
8
+ const rendered = render ? render(props) : children;
7
9
  return /* @__PURE__ */ jsx(
8
10
  Box,
9
11
  {
@@ -14,7 +16,7 @@ const WmTopNav = (props) => {
14
16
  role: "navigation",
15
17
  "aria-label": "Second level navigation",
16
18
  "data-role": "page-topnav",
17
- children: render ? render(props) : children
19
+ children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: rendered })
18
20
  }
19
21
  );
20
22
  };
@@ -3,6 +3,7 @@ export interface TopNavProps {
3
3
  className?: string;
4
4
  styles?: React.CSSProperties;
5
5
  id?: string;
6
+ content?: string;
6
7
  render?: (props: Record<string, any>) => React.ReactNode;
7
8
  }
8
9
  export type WmTopNavProps = TopNavProps;