@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
@@ -1,8 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, IconButton } from "@mui/material";
3
3
  import DOMPurify from "dompurify";
4
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
5
- import ExpandLessIcon from "@mui/icons-material/ExpandLess";
6
4
  import FullscreenIcon from "@mui/icons-material/Fullscreen";
7
5
  import FullscreenExitIcon from "@mui/icons-material/FullscreenExit";
8
6
  import CloseIcon from "@mui/icons-material/Close";
@@ -137,7 +135,7 @@ const PanelHeader = ({
137
135
  title: `${(_b = (_a = listener == null ? void 0 : listener.appLocale) == null ? void 0 : _a.LABEL_COLLAPSE) != null ? _b : "Collapse"}/${(_d = (_c = listener == null ? void 0 : listener.appLocale) == null ? void 0 : _c.LABEL_EXPAND) != null ? _d : "Expand"}`,
138
136
  onClick: onToggleExpand,
139
137
  "aria-expanded": isExpanded,
140
- children: isExpanded ? /* @__PURE__ */ jsx(ExpandLessIcon, { className: "wi-minus" }) : /* @__PURE__ */ jsx(ExpandMoreIcon, { className: "wi-plus" })
138
+ children: /* @__PURE__ */ jsx(Box, { component: "i", className: isExpanded ? "wi-minus" : "wi-plus" })
141
139
  }
142
140
  ),
143
141
  enablefullscreen && /* @__PURE__ */ jsx(
@@ -39,6 +39,7 @@ declare const _default: React.ComponentType<{
39
39
  onHeaderClick?: (event: React.SyntheticEvent, props: WmTabPaneProps, paneIndex: number) => void;
40
40
  renderPartial?: (props: WmTabPaneProps, onLoad?: (widget?: WmTabPaneProps) => void) => React.ReactNode;
41
41
  layoutClassName?: string;
42
+ direction?: string;
42
43
  standalone?: boolean;
43
44
  ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
44
45
  animation?: string;
@@ -98,7 +98,7 @@ const WmTabpane = (props) => {
98
98
  }, [name, headerProps, updatePaneHeader]);
99
99
  return /* @__PURE__ */ jsx(
100
100
  Tabs.Panel,
101
- __spreadProps(__spreadValues({
101
+ __spreadProps(__spreadValues(__spreadValues({
102
102
  value: index,
103
103
  keepMounted: true,
104
104
  className: clsx("tab-pane", "wm-tab-pane-root", layoutClassName, {
@@ -113,7 +113,7 @@ const WmTabpane = (props) => {
113
113
  style: props == null ? void 0 : props.styles,
114
114
  "data-pane-name": name,
115
115
  title: props == null ? void 0 : props.title
116
- }, { name }), {
116
+ }, { name }), props.direction ? { direction: props.direction } : {}), {
117
117
  children: /* @__PURE__ */ jsx("div", { className: "tab-body", "data-widget-id": props["data-widget-id"], children: renderPartial ? renderPartial(
118
118
  props,
119
119
  () => {
@@ -78,6 +78,7 @@ export interface TabPanePropsBase {
78
78
  * Utility layout classes from Studio Auto Layout (merged on the outer tab-pane wrapper).
79
79
  */
80
80
  layoutClassName?: string;
81
+ direction?: string;
81
82
  }
82
83
  /**
83
84
  * Combined props for the WmTabPane component, including base WaveMaker props.
@@ -97,6 +97,7 @@ const WmWizardComponent = memo(
97
97
  const formRefs = useRef({});
98
98
  const stepContainerRefs = useRef({});
99
99
  const navIndexRef = useRef(-1);
100
+ const loadedStepNameRef = useRef(null);
100
101
  const [formReady, setFormReady] = useState(false);
101
102
  const parentFormContext = useParentFormData();
102
103
  const isInsideOuterForm = !!parentFormContext && Object.keys(parentFormContext).length > 0;
@@ -469,12 +470,6 @@ const WmWizardComponent = memo(
469
470
  });
470
471
  })
471
472
  );
472
- setTimeout(() => {
473
- if (step.onLoad) {
474
- const stepIndex = visibleSteps.findIndex((s) => s.name === step.name);
475
- step.onLoad(step, stepIndex);
476
- }
477
- }, 100);
478
473
  } else {
479
474
  const nextValidStep = getNextValidStep(0, visibleSteps);
480
475
  if (nextValidStep) {
@@ -583,10 +578,16 @@ const WmWizardComponent = memo(
583
578
  visibleSteps
584
579
  ]);
585
580
  useEffect(() => {
586
- if (currentStep == null ? void 0 : currentStep.onLoad) {
587
- currentStep == null ? void 0 : currentStep.onLoad(currentStep, currentStepIndex);
588
- }
589
- }, [currentStep == null ? void 0 : currentStep.onLoad]);
581
+ if (!(currentStep == null ? void 0 : currentStep.onLoad) || loadedStepNameRef.current === currentStep.name) return;
582
+ const step = currentStep;
583
+ const timer = setTimeout(() => {
584
+ var _a;
585
+ if (loadedStepNameRef.current === step.name) return;
586
+ loadedStepNameRef.current = step.name;
587
+ (_a = step.onLoad) == null ? void 0 : _a.call(step, step, currentStepIndex);
588
+ }, 100);
589
+ return () => clearTimeout(timer);
590
+ }, [currentStep == null ? void 0 : currentStep.name, currentStep == null ? void 0 : currentStep.onLoad, currentStepIndex]);
590
591
  useEffect(() => {
591
592
  if (type === "dynamic" && dataset.length > 0 && steps.length === 0) {
592
593
  const dynamicSteps = createDynamicSteps(dataset);
@@ -44,6 +44,7 @@ const getStepByIndex = (index, visibleSteps) => {
44
44
  };
45
45
  const updateStepFocus = () => {
46
46
  setTimeout(() => {
47
+ if (typeof document === "undefined") return;
47
48
  const currentStepElement = document.querySelector(
48
49
  ".MuiStepButton-root[aria-current='step']"
49
50
  );
@@ -0,0 +1,11 @@
1
+ import { FormFieldMetadata } from "./props";
2
+ export type WmxFormFieldProps = Record<string, unknown> & {
3
+ class?: string;
4
+ className?: string;
5
+ };
6
+ type WmxDynamicFormFieldProps = {
7
+ field: FormFieldMetadata;
8
+ fieldProps: WmxFormFieldProps;
9
+ };
10
+ export declare const WmxDynamicFormField: ({ field, fieldProps }: WmxDynamicFormFieldProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,77 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { jsx } from "react/jsx-runtime";
33
+ import { useEffect, useMemo, useState } from "react";
34
+ import WmText from "../../../input/text";
35
+ import withFormController from "../form-controller/withFormController";
36
+ import { loadWmxComponent, getWmxComponentName } from "../../../../utils/wmx.utils";
37
+ const WmxDynamicFormField = ({ field, fieldProps }) => {
38
+ var _b;
39
+ const componentName = getWmxComponentName(String((field == null ? void 0 : field.widget) || ""));
40
+ const _a = fieldProps, { class: className } = _a, restProps = __objRest(_a, ["class"]);
41
+ const resolvedClassName = className || fieldProps.className;
42
+ const [RawComponent, setRawComponent] = useState(null);
43
+ useEffect(() => {
44
+ if (!componentName) return;
45
+ let isActive = true;
46
+ loadWmxComponent(componentName).then((component) => {
47
+ if (isActive) {
48
+ setRawComponent(component);
49
+ }
50
+ }).catch((e) => {
51
+ console.error(e);
52
+ });
53
+ return () => {
54
+ isActive = false;
55
+ };
56
+ }, [componentName]);
57
+ const EnhancedWmxComponent = useMemo(() => {
58
+ if (!RawComponent) return null;
59
+ return withFormController(RawComponent);
60
+ }, [RawComponent]);
61
+ if (!EnhancedWmxComponent) {
62
+ return /* @__PURE__ */ jsx(WmText, __spreadProps(__spreadValues({ name: field == null ? void 0 : field.name }, restProps), { className: resolvedClassName }));
63
+ }
64
+ const dataset = (_b = field == null ? void 0 : field.dataset) != null ? _b : fieldProps == null ? void 0 : fieldProps.dataset;
65
+ return /* @__PURE__ */ jsx(
66
+ EnhancedWmxComponent,
67
+ __spreadProps(__spreadValues({
68
+ componentname: componentName
69
+ }, restProps), {
70
+ className: resolvedClassName,
71
+ dataset
72
+ })
73
+ );
74
+ };
75
+ export {
76
+ WmxDynamicFormField
77
+ };
@@ -42,7 +42,12 @@ import WmLabel from "../../../basic/label";
42
42
  import WmFormField from "../form-field";
43
43
  import { updateMetadata } from "./utils";
44
44
  import { COMPONENT_MAP } from "./constant";
45
+ import { WmxDynamicFormField } from "./WmxDynamicFormField";
45
46
  const DEFAULT_FIELD_CLASS = "app-dynamic-form-field";
47
+ const isWmxComponent = (field) => {
48
+ var _a;
49
+ return (_a = field == null ? void 0 : field.widget) == null ? void 0 : _a.includes("wmx-");
50
+ };
46
51
  function DynamicForm(props) {
47
52
  const {
48
53
  metadata,
@@ -74,7 +79,6 @@ function DynamicForm(props) {
74
79
  return Math.floor(12 / columns);
75
80
  };
76
81
  const renderFormField = (field) => {
77
- const ComponentToRender = COMPONENT_MAP[field.widget] || WmText;
78
82
  const fieldProps = __spreadValues(__spreadProps(__spreadValues({}, field), {
79
83
  className: field.class,
80
84
  listener,
@@ -84,8 +88,15 @@ function DynamicForm(props) {
84
88
  onChangeHandler: formContext.onChangeHandler
85
89
  });
86
90
  const _a = fieldProps, { class: className } = _a, restProps = __objRest(_a, ["class"]);
91
+ if (isWmxComponent(field)) {
92
+ return handleWmxFormFieldRendering(field, fieldProps);
93
+ }
94
+ const ComponentToRender = COMPONENT_MAP[field.widget] || WmText;
87
95
  return /* @__PURE__ */ jsx(ComponentToRender, __spreadProps(__spreadValues({}, restProps), { className: className || fieldProps.className }));
88
96
  };
97
+ const handleWmxFormFieldRendering = (field, fieldProps) => {
98
+ return /* @__PURE__ */ jsx(WmxDynamicFormField, { field, fieldProps });
99
+ };
89
100
  const renderFormFieldWithWrapper = (field) => {
90
101
  const columnWidth = getColumnWidth(field.columnwidth);
91
102
  return /* @__PURE__ */ jsx(
@@ -325,20 +325,6 @@ const withFormController = (WrappedComponent) => {
325
325
  })()
326
326
  }
327
327
  ),
328
- hint && !shouldShowErrorMessage(validationType, fieldState, touched) && /* @__PURE__ */ jsx(
329
- "p",
330
- {
331
- className: "help-block",
332
- "aria-hidden": "true",
333
- role: "alert",
334
- "aria-live": "polite",
335
- style: {
336
- textAlign: "start",
337
- width: "100%"
338
- },
339
- children: hint
340
- }
341
- ),
342
328
  shouldShowErrorMessage(validationType, fieldState, touched) && /* @__PURE__ */ jsx(
343
329
  "p",
344
330
  {
@@ -37,7 +37,7 @@ const DATASET_SYNC_KEYS = [
37
37
  ];
38
38
  const WmFormField = memo(
39
39
  (props) => {
40
- var _a, _b, _c, _d;
40
+ var _a, _b, _c, _d, _e;
41
41
  const { show = true, deferload } = props;
42
42
  const [proxyProps, setProxyProps] = useState(__spreadProps(__spreadValues({}, props), {
43
43
  show: show == null ? void 0 : show.toString(),
@@ -50,7 +50,7 @@ const WmFormField = memo(
50
50
  const fieldKey = props.formKey || props.name;
51
51
  const defaultValueRegisteredRef = useRef(false);
52
52
  const showfield = (_b = (_a = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _a.show) != null ? _b : show;
53
- const formReady = (formProxy == null ? void 0 : formProxy.listener) !== void 0;
53
+ const formReady = (formProxy == null ? void 0 : formProxy.listener) !== void 0 || ((_c = props.formRef) == null ? void 0 : _c.name) === props.formName;
54
54
  const reset = useCallback(
55
55
  (value) => {
56
56
  const field = fieldProxyRef.current;
@@ -110,17 +110,20 @@ const WmFormField = memo(
110
110
  });
111
111
  }, [props.dataset, props.datafield, props.displayfield, props.displaylabel, props.searchkey]);
112
112
  function renderFormFields() {
113
- var _a2, _b2, _c2, _d2, _e, _f, _g;
113
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h;
114
114
  if (props.formRef) {
115
115
  const errors = (_a2 = props.formRef) == null ? void 0 : _a2.errors;
116
116
  const formKey = (_b2 = props.formKey) != null ? _b2 : props.name;
117
117
  const fieldError = formKey && errors ? get(errors, formKey) : void 0;
118
118
  const invalid = Boolean(fieldError);
119
119
  const invalidCls = invalid ? " text-danger " : "";
120
- return /* @__PURE__ */ jsx(Fragment, { children: (_g = props == null ? void 0 : props.renderFormFields) == null ? void 0 : _g.call(props, __spreadProps(__spreadValues(__spreadValues({}, proxyProps), overriddenItemsRef.current), {
120
+ return /* @__PURE__ */ jsx(Fragment, { children: (_h = props == null ? void 0 : props.renderFormFields) == null ? void 0 : _h.call(props, __spreadProps(__spreadValues(__spreadValues({}, proxyProps), overriddenItemsRef.current), {
121
121
  show: showfield,
122
122
  disabled: (_d2 = (_c2 = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _c2.disabled) != null ? _d2 : props == null ? void 0 : props.disabled,
123
- readonly: (_f = (_e = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _e.readonly) != null ? _f : props == null ? void 0 : props.readonly,
123
+ readonly: (_f = (_e2 = overriddenItemsRef == null ? void 0 : overriddenItemsRef.current) == null ? void 0 : _e2.readonly) != null ? _f : props == null ? void 0 : props.readonly,
124
+ // BaseField derives this from live validators. A direct field-proxy write wins,
125
+ // but never fall back to the initial proxyProps.required snapshot.
126
+ required: (_g = overriddenItemsRef.current.required) != null ? _g : props.required,
124
127
  fieldError,
125
128
  validators: props.validators,
126
129
  asyncValidators: props.asyncValidators,
@@ -135,12 +138,12 @@ const WmFormField = memo(
135
138
  }
136
139
  }
137
140
  const isDynamicFormField = typeof props.className === "string" && props.className.includes("app-dynamic-form-field");
138
- const itemsPerRowClass = !isDynamicFormField && ((_c = props.formRef) == null ? void 0 : _c.itemsPerRow) || "";
141
+ const itemsPerRowClass = !isDynamicFormField && ((_d = props.formRef) == null ? void 0 : _d.itemsPerRow) || "";
139
142
  if (!fieldProxyRef.current) {
140
143
  return null;
141
144
  }
142
145
  const isDeferLoad = deferload === true;
143
- const showValue = ((_d = proxyProps == null ? void 0 : proxyProps.show) == null ? void 0 : _d.toString()) !== "false";
146
+ const showValue = ((_e = proxyProps == null ? void 0 : proxyProps.show) == null ? void 0 : _e.toString()) !== "false";
144
147
  if ((!showValue || showfield) && isDeferLoad) {
145
148
  return null;
146
149
  }
@@ -511,7 +511,7 @@ const WmList = (props) => {
511
511
  );
512
512
  return /* @__PURE__ */ jsxs(
513
513
  Box,
514
- __spreadProps(__spreadValues({
514
+ __spreadProps(__spreadValues(__spreadProps(__spreadValues({
515
515
  className: clsx(
516
516
  DEFAULT_CLS,
517
517
  "wm-position-relative",
@@ -523,7 +523,8 @@ const WmList = (props) => {
523
523
  "data-name": name
524
524
  }, { name }), {
525
525
  "data-navigation": navigation,
526
- ref: ListWrapperRef,
526
+ ref: ListWrapperRef
527
+ }), direction ? { direction } : {}), {
527
528
  children: [
528
529
  /* @__PURE__ */ jsx(
529
530
  ListHeader,
@@ -71,7 +71,7 @@ const RowCells = memo(
71
71
  tabIndex: 0,
72
72
  "data-col-id": cellIndex,
73
73
  className: `${TABLE_CSS_CLASSES.tableCell} ${colClass || ""} ${((_e = cell.column.columnDef.meta) == null ? void 0 : _e.className) || ""}`.trim(),
74
- style: __spreadProps(__spreadValues(__spreadValues({
74
+ style: __spreadValues(__spreadProps(__spreadValues(__spreadValues({
75
75
  width: cell.column.getSize(),
76
76
  textAlign: (_f = cell.column.columnDef.meta) == null ? void 0 : _f.textAlign,
77
77
  backgroundColor: (_g = cell.column.columnDef.meta) == null ? void 0 : _g.backgroundColor
@@ -95,6 +95,8 @@ const RowCells = memo(
95
95
  })()), getDomHiddenCellStyle(cell.column.columnDef.meta)), {
96
96
  fontSize: "inherit",
97
97
  color: "inherit"
98
+ }), hasCustomCellContent && {
99
+ textOverflow: "clip"
98
100
  }),
99
101
  children: customRender ? /* @__PURE__ */ jsx(CustomExpressionRenderBody, { rowData, render: customRender }) : ((_h = cell.column.columnDef.meta) == null ? void 0 : _h.renderCellContent) && !isEditingRow ? (_i = cell.column.columnDef.meta) == null ? void 0 : _i.renderCellContent(rowData, cell.column.columnDef) : flexRender(cell.column.columnDef.cell, cell.getContext())
100
102
  },
@@ -380,6 +380,7 @@ const TableHeaderComponent = memo(
380
380
  const isClickable = enablecolumnselection && !isSystemColumn || enablesort && header.column.getCanSort();
381
381
  const headerCellResizableClass = header.column.getCanResize() ? " ui-resizable" : "";
382
382
  const headerMeta = header.column.columnDef.meta;
383
+ const isMultiSelectHeader = columnId === "multiSelect";
383
384
  cells.push(
384
385
  /* @__PURE__ */ jsxs(
385
386
  TableCell,
@@ -402,7 +403,10 @@ const TableHeaderComponent = memo(
402
403
  tabIndex: 0,
403
404
  "data-col-field": header.column.id,
404
405
  children: [
405
- /* @__PURE__ */ jsx("span", { className: "header-data", children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }),
406
+ isMultiSelectHeader && !header.isPlaceholder ? /* @__PURE__ */ jsxs(Fragment, { children: [
407
+ flexRender(header.column.columnDef.header, header.getContext()),
408
+ /* @__PURE__ */ jsx("span", { className: "header-data", children: "\xA0" })
409
+ ] }) : /* @__PURE__ */ jsx("span", { className: "header-data", children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }),
406
410
  enablesort && !enablecolumnselection && header.column.getCanSort() && /* @__PURE__ */ jsx(
407
411
  Box,
408
412
  {
@@ -1,5 +1,7 @@
1
1
  import { UseRowHandlersProps, UseRowHandlersReturn } from "../props";
2
2
  /**
3
- * Hook to consolidate all row click handlers
3
+ * Hook to consolidate all row click handlers.
4
+ * Angular rowSelectionHandler: callOnRowClickEvent first, then toggle + onRowSelect.
5
+ * Checkbox/radio clicks bubble to the row (rowclick), then onChange fires rowselect.
4
6
  */
5
- export declare const useRowHandlers: ({ editingRowId, isAddingNewRow, handleRowSelectionClick, handleTableEditRowClick, handleRowActiveClick, onRowclick, useRadioSelect, useMultiSelect, isrowselectable, listener, name, }: UseRowHandlersProps) => UseRowHandlersReturn;
7
+ export declare const useRowHandlers: ({ editingRowId, isAddingNewRow, handleRowSelectionClick, handleTableEditRowClick, handleRowActiveClick, onRowclick, useRadioSelect, useMultiSelect, isrowselectable, listener, viewParent, name, widgetRegistrationKey, }: UseRowHandlersProps) => UseRowHandlersReturn;
@@ -1,5 +1,6 @@
1
1
  import { useCallback } from "react";
2
2
  import { cleanRowData } from "../utils";
3
+ import { getWidgetForCallback } from "../utils/selectionUtils";
3
4
  const useRowHandlers = ({
4
5
  editingRowId,
5
6
  isAddingNewRow,
@@ -11,18 +12,29 @@ const useRowHandlers = ({
11
12
  useMultiSelect = false,
12
13
  isrowselectable = false,
13
14
  listener,
14
- name
15
+ viewParent,
16
+ name,
17
+ widgetRegistrationKey
15
18
  }) => {
19
+ const widgetKey = widgetRegistrationKey != null ? widgetRegistrationKey : name;
20
+ const getWidgetRef = useCallback(
21
+ () => getWidgetForCallback(listener, viewParent, widgetKey),
22
+ [viewParent, widgetKey]
23
+ );
24
+ const invokeRowClick = useCallback(
25
+ (event, rowData) => {
26
+ if (!onRowclick) return;
27
+ const widget = getWidgetRef();
28
+ if (widget) {
29
+ widget.nativeElement = event.target;
30
+ }
31
+ onRowclick(event, widget, cleanRowData(rowData));
32
+ },
33
+ [onRowclick, getWidgetRef]
34
+ );
16
35
  const handleRowClick = useCallback(
17
36
  (event, rowData, rowId) => {
18
- var _a, _b;
19
37
  const hasSelectionMode = useRadioSelect || useMultiSelect;
20
- if (onRowclick) {
21
- if ((_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]) {
22
- listener.Widgets[name].nativeElement = event.target;
23
- }
24
- onRowclick(event, (_b = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _b[name], cleanRowData(rowData));
25
- }
26
38
  let isSelectionHandled = false;
27
39
  if (hasSelectionMode && isrowselectable) {
28
40
  isSelectionHandled = handleRowSelectionClick(event, rowId, rowData);
@@ -35,6 +47,7 @@ const useRowHandlers = ({
35
47
  return;
36
48
  }
37
49
  handleRowActiveClick(rowId, isSelectionHandled, isEditingOrAdding);
50
+ invokeRowClick(event, rowData);
38
51
  },
39
52
  [
40
53
  editingRowId,
@@ -42,11 +55,10 @@ const useRowHandlers = ({
42
55
  handleRowSelectionClick,
43
56
  handleTableEditRowClick,
44
57
  handleRowActiveClick,
45
- onRowclick,
58
+ invokeRowClick,
46
59
  useRadioSelect,
47
60
  useMultiSelect,
48
- isrowselectable,
49
- name
61
+ isrowselectable
50
62
  ]
51
63
  );
52
64
  return {
@@ -1,2 +1,2 @@
1
1
  import { UseRowSelectionProps, UseRowSelectionReturn } from "../props";
2
- export declare const useRowSelection: ({ radioselect, multiselect, gridfirstrowselect, internalDataset, cellState, name, statehandler, initialActualPageSize, getTableState: getTableCurrentState, onRowselect, onRowdeselect, listener, navigation, onSyncSelectedItems, }: UseRowSelectionProps) => UseRowSelectionReturn;
2
+ export declare const useRowSelection: ({ radioselect, multiselect, gridfirstrowselect, internalDataset, cellState, name, statehandler, initialActualPageSize, getTableState: getTableCurrentState, onRowselect, onRowdeselect, listener, navigation, viewParent, widgetRegistrationKey, onSyncSelectedItems, }: UseRowSelectionProps) => UseRowSelectionReturn;